Skip to main content

Digest

type Digest

A 32-byte Blake2b256 hash output.

BCS

A `Digest`'s BCS serialized form is defined by the following:

```text digest = %d32 32OCTET ```

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 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) ToBytes

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