Documentation ¶
Overview ¶
Package namespace contains the core namespaced data types. PrefixedData represents the leaf data that gets pushed to the NMT (data prefixed with an ID).
Index ¶
Constants ¶
const IDMaxSize = math.MaxUint8
IDMaxSize defines the max. allowed namespace ID size in bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID []byte
func (ID) LessOrEqual ¶
LessOrEqual returns true if nid <= other, otherwise, false.
type IDSize ¶
type IDSize uint8
IDSize is the number of bytes a namespace uses. Valid values are in [0,255].
type PrefixedData ¶
type PrefixedData []byte
PrefixedData simply represents a slice of bytes which consists of a namespace.ID and raw data. The user has to guarantee that the bytes are valid namespace prefixed data. Go's type system does not allow enforcing the structure we want: [namespaceID, rawData ...], especially as this type does not expect any particular size for the namespace.