struct UInt128

Overview

monkey patch UInt128 to introduce a new class method onto UInt128

Defined in:

extlib.cr

Constructors

Class Method Summary

Constructor Detail

def self.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.


[View source]
def self.rand(random : Random = Random) : UInt128 #

[View source]

Class Method Detail

def self.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.


[View source]