Helios API/ API Reference/ Classes/

Hash

Base class of all hash-types

Hierarchy

Index

Constructors

constructor

new Hash(props)

Parameters

NameType
propsHashProps

Overrides

HeliosData.constructor

Properties

bytes

Readonly bytes: number[]

Accessors

hex

get hex(): string

Hexadecimal representation.

Returns

string

Methods

eq

eq(other): boolean

Parameters

NameType
otherHash

Returns

boolean

toCbor

toCbor(): number[]

Returns

number[]

Inherited from

HeliosData.toCbor

toCborHex

toCborHex(): string

Returns

string

Inherited from

HeliosData.toCborHex

toSchemaJson

toSchemaJson(): string

Returns

string

Inherited from

HeliosData.toSchemaJson

compare

Static compare(a, b): number

Parameters

NameType
aHash
bHash

Returns

number

fromCbor

Static fromCbor(bytes): Hash

Used internally for metadataHash and scriptDataHash

Parameters

NameType
bytesnumber[]

Returns

Hash

fromHex

Static fromHex(str): Hash

Might be needed for internal use

Parameters

NameType
strstring

Returns

Hash

fromProps

Static fromProps(props): Hash

Parameters

NameType
propsHash | HashProps

Returns

Hash