Documentation ¶
Overview ¶
Package ternary implements ternary encoding as specified by the IOTA Protocol RFC-0015. https://github.com/Wollac/iota-crypto-demo/blob/master/pkg/encoding/ternary/ternary.go
Index ¶
- func BytesToTrytes(bytes []byte) (trinary.Trytes, error)
- func MustBytesToTrytes(bytes []byte) trinary.Trytes
- func MustTrytesToBytes(trytes trinary.Trytes) []byte
- func TrytesToBytes(trytes trinary.Trytes) ([]byte, error)
- func ValidBytesForTrytes(bytes []byte) error
- func ValidTrytesForBytes(trytes trinary.Trytes) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToTrytes ¶
BytesToTrytes converts a bit string into its ternary representation encoding one byte a two trytes.
func MustBytesToTrytes ¶
MustBytesToTrytes converts a bit string into its ternary representation encoding one byte a two trytes. The input is not validated before the computation.
func MustTrytesToBytes ¶
MustTrytesToBytes the ternary representation of a bit string back to its original slice of bytes. The input is not validated before the computation.
func TrytesToBytes ¶
TrytesToBytes the ternary representation of a bit string back to its original slice of bytes.
func ValidBytesForTrytes ¶
ValidBytesForTrytes checks whether the given slice of bytes is a valid input for BytesToTrytes.
func ValidTrytesForBytes ¶
ValidTrytesForBytes checks whether the given trytes are a valid input for TrytesToBytes.
Types ¶
This section is empty.