struct UInt128
- UInt128
- Int
- Number
- Value
- Object
Overview
monkey patch UInt128 to introduce a new class method onto UInt128
Defined in:
extlib.crConstructors
-
.from_bytes(bytes : Bytes | StaticArray(UInt8, 16)) : UInt128
converts a slice of bytes in which bytes[0] is the low-order byte of the u128 and bytes[15] is the high order byte of the u128 back into the corresponding u128 Assumes
.bytes
in little endian format. - .rand(random : Random = Random) : UInt128
Class Method Summary
-
.bytes(u128_p : Pointer(UInt128)) : Slice(UInt8)
converts the u128 into a slice of bytes in which bytes[0] is the low-order byte of the u128 and bytes[15] is the high order byte of the u128 Returns a Slice(UInt8) in little endian format.
Constructor Detail
converts a slice of bytes in which bytes[0] is the low-order byte of the u128 and bytes[15] is the high order byte of the u128 back into the corresponding u128
Assumes .bytes
in little endian format.
Class Method Detail
converts the u128 into a slice of bytes in which bytes[0] is the low-order byte of the u128 and bytes[15] is the high order byte of the u128 Returns a Slice(UInt8) in little endian format.