Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Canonicalize ¶
Canonicalize returns hash-format representation of the data structure. Use the opts parameter for applying additional serialization options.
Nested types must implement Canonicalizer interface.
The implementation makes use of struct tags with the key 'hsh' as serialization template. Available options:
- 'idx' [mandatory]: binary serialization sequence for given field.
- 'size' [optional] : integer value size expressed in bytes. Supported values 1, 4, 8. If not set 1 is used as default.
e.g.
type Object struct { Number uint64 `hsh:"idx=1,size=8"` Slice []byte `hsh:"idx=2"` }
func RegisterTemplate ¶
func RegisterTemplate(o interface{})
Types ¶
type Canonicalizer ¶
Canonicalizer Interface for serializing data structures into deterministic hash-format.
Click to show internal directories.
Click to hide internal directories.