Skip to main content

Digest

type Digest​

A 32-byte Blake2b256 hash output.

BCS​

The BCS serialized form of this type is specified in [`bcs-schema.abnf`](https://github.com/iotaledger/iota-rust-sdk/blob/develop/crates/iota-sdk-types/bcs-schema.abnf\).

Due to historical reasons, even though a `Digest` has a fixed-length of 32, IOTA's binary representation of a `Digest` is prefixed with its length meaning its serialized binary form (in bcs) is 33 bytes long vs a more compact 32 bytes.

type Digest struct {
// contains filtered or unexported fields
}

func DigestFromBase58​

func DigestFromBase58(base58 string) (*Digest, error)

func DigestFromBcs​

func DigestFromBcs(bcs []byte) (*Digest, error)

Create this type from BCS encoded bytes.

func DigestFromBytes​

func DigestFromBytes(bytes []byte) (*Digest, error)

func DigestFromJson​

func DigestFromJson(json string) (*Digest, error)

Create this type from a JSON encoded string.

func DigestRandom​

func DigestRandom() *Digest

func LiftFromExternalDigest​

func LiftFromExternalDigest(handle uint64) *Digest

func (*Digest) DebugString​

func (_self *Digest) DebugString() string

func (*Digest) Destroy​

func (object *Digest) Destroy()

func (*Digest) Eq​

func (_self *Digest) Eq(other *Digest) bool

func (*Digest) Hash​

func (_self *Digest) Hash() uint64

func (*Digest) Ne​

func (_self *Digest) Ne(other *Digest) bool

func (*Digest) NextLexicographical​

func (_self *Digest) NextLexicographical() *Digest

Returns the next digest in byte-increasing order.

func (*Digest) NextLexicographicalOpt​

func (_self *Digest) NextLexicographicalOpt() **Digest

Returns the next digest in byte-increasing order, or `None` if the result would overflow.

func (*Digest) String​

func (_self *Digest) String() string

func (*Digest) ToBase58​

func (_self *Digest) ToBase58() string

func (*Digest) ToBcs​

func (_self *Digest) ToBcs() ([]byte, error)

Convert this type to BCS encoded bytes.

func (*Digest) ToBytes​

func (_self *Digest) ToBytes() []byte

func (*Digest) ToDisplayString​

func (_self *Digest) ToDisplayString() string

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

func (*Digest) ToJson​

func (_self *Digest) ToJson() (string, error)

Convert this type to a JSON encoded string.