bespoke/serializable

Types

Returned when deserializing a bespoke fails due to being improperly formatted / encoded

pub type DeserializationError {
  InvalidBitSize
  InvalidHexString
  MissingPrefix
}

Constructors

  • InvalidBitSize

    The amount of bits for the bespoke was not 2048

  • InvalidHexString

    The string contained non-hex characters (excluding the prefix)

  • MissingPrefix

    The string did not start with bespoke_

A bespoke that can be serialized and deserialized

This has a memory overhead of 2048 bits

Two created instances could be equal in inplausable circumstances, but this is highly unlikely

pub type SerializableBespoke

Values

pub fn deserialize(
  serialized: String,
) -> Result(SerializableBespoke, DeserializationError)

Attempts to decode from a base16 string

This expects that the string is prefixed with bespoke_

pub fn new() -> SerializableBespoke

Creates a new serializable bespoke that is guaranteed* to be unique

pub fn serialize(bespoke: SerializableBespoke) -> String

Encodes into a base16 string

This will be prefixed with bespoke_

Search Document