Documentation ¶
Overview ¶
Package nixbase32 implements the slightly odd "base32" encoding that's used in Nix.
Nix uses a custom alphabet. Contrary to other implementations (RFC4648), encoding to "nix base32" also reads in characters in reverse order (and doesn't use any padding), which makes adopting encoding/base32 hard.
Index ¶
Constants ¶
const Alphabet = "0123456789abcdfghijklmnpqrsvwxyz"
Alphabet contains the list of valid characters for the Nix base32 Alphabet.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode decodes src using nixbase32. It writes at most DecodedLen of len(src) bytes to dst and returns the number of bytes written.
func DecodeString ¶
DecodeString returns the bytes represented by the nixbase32 string s or returns an error.
func DecodedLen ¶
DecodedLen returns the length in bytes of the decoded data corresponding to n bytes of base32-encoded data. If we have bits that don't fit into here, they are padding and must be 0.
func Encode ¶
func Encode(dst, src []byte)
Encode encodes src using nixbase32, writing EncodedLen of len(src) bytes to dst.
func EncodeToString ¶
EncodeToString returns the nixbase32 encoding of src.
func EncodedLen ¶
EncodedLen returns the length in bytes of the base32 encoding of an input buffer of length n.
func ValidateString ¶
ValidateString returns an error if s is not valid nixbase32.
Types ¶
This section is empty.