Home > borogove > Hash

Hash class

Signature:

export class Hash 

Constructors

Constructor Modifiers Description
(constructor)(algorithm, hash) protected Constructs a new instance of the Hash class

Properties

Property Modifiers Type Description
algorithm string Hash algorithm name

Methods

Method Modifiers Description
fromHex(algorithm, hash) static Create a new Hash from a hex string
fromUri(uri) static Create a new Hash from a ni:, cid: or similar URI
toBase64() Represent this Hash as a Base64 string
toBase64Url() Represent this Hash as a Base64url string
toHex() Represent this Hash as a hex string
toUri() Represent this Hash as a URI