class NamedInformation::BinHash

Defined in:

named_information/bin_hash.cr

Constant Summary

AFTER_DESERIALIZE = [] of Nil
BEFORE_SERIALIZE = [] of Nil
ENDIAN = ["network"]
KLASS_NAME = [NamedInformation::BinHash]
PARTS = [{type: "bitfield", name: 0, cls: NamedInformation::BinHash, onlyif: nil, verify: nil}, {type: "bytes", name: hash_value, cls: Slice(UInt8), onlyif: nil, verify: nil, length: -> do bits = ALGORITHM_ID[suite_id.to_s][:truncate] || 256 bits // 8 end, value: nil}] of Nil
REMAINING = [] of Nil

Class Method Summary

Macro Summary

Instance Method Summary

Class Method Detail

def self.bit_fields #

[View source]

Macro Detail

macro named_information_bin_hash(name, onlyif = nil, verify = nil, value = nil) #

[View source]

Instance Method Detail

def __format__ : IO::ByteFormat #

[View source]
def algorithm #

[View source]
def hash #
Description copied from class Object

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with == by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.


[View source]
def hash_value : Bytes #

def hash_value=(hash_value : Bytes) #

def reserved : UInt8 #

Res field is a reserved 2-bit field for future use


def reserved=(reserved : UInt8) #

Res field is a reserved 2-bit field for future use


def suite_id : UInt8 #

The hash algorithm and truncation length are specified by the Suite ID


def suite_id=(suite_id : UInt8) #

The hash algorithm and truncation length are specified by the Suite ID


def to_hash #

[View source]
def to_u128 : UInt128 #

[View source]