struct NamedInformation::Hash

Included Modules

Defined in:

named_information/hash.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(hash : String, algorithm : String, authority : String | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new(ni : String) #

[View source]
def self.new(ni : URI) #

[View source]
def self.new(bytes : Bytes) #

[View source]
def self.new(integer : UInt128) #

[View source]

Instance Method Detail

def ==(other : self) #

we don't require authority to have two hashes match


[View source]
def algorithm : String #

[View source]
def authority : String | Nil #

[View source]
def hash : String #
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 matches?(content : String | Bytes, authority : String | Nil = nil) : Bool #

[View source]
def params : NamedTuple(algorithm: String, truncate: Int32 | Nil) #

[View source]
def to_bin #

[View source]
def to_human_speakable(checkdigit : Bool = true) #

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

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
def to_segment #

[View source]
def to_slice : Bytes #

[View source]
def to_u128 : UInt128 #

[View source]
def to_uri #

[View source]
def to_well_known #

[View source]