Documentation
¶
Overview ¶
Package binarysort provides types and functions to encode into naturally sorted binary representations. That way, if vA < vB, where vA and vB are two unencoded values of the same type, then eA < eB, where eA and eB are the respective encoded values of vA and vB.
Index ¶
- func AppendBase64(buf []byte, data []byte) ([]byte, error)
- func AppendBool(buf []byte, x bool) []byte
- func AppendFloat64(buf []byte, x float64) []byte
- func AppendInt64(buf []byte, x int64) []byte
- func AppendUint64(buf []byte, x uint64) []byte
- func DecodeBase64(data []byte) ([]byte, error)
- func DecodeBool(buf []byte) (bool, error)
- func DecodeFloat64(buf []byte) (float64, error)
- func DecodeInt64(buf []byte) (int64, error)
- func DecodeUint64(buf []byte) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendBase64 ¶
AppendBase64 encodes data into a custom base64 encoding. The resulting slice respects natural sort-ordering.
func AppendBool ¶
AppendBool takes a bool and returns its binary representation.
func AppendFloat64 ¶
AppendFloat64 takes an float64 and returns its binary representation.
func AppendInt64 ¶
AppendInt64 takes an int64 and returns its binary representation.
func AppendUint64 ¶
AppendUint64 takes an uint64 and returns its binary representation.
func DecodeBase64 ¶
DecodeBase64 decodes a custom base64 encoded byte slice, encoded with AppendBase64.
func DecodeBool ¶
DecodeBool takes a byte slice and decodes it into a boolean.
func DecodeFloat64 ¶
DecodeFloat64 takes a byte slice and decodes it into an float64.
func DecodeInt64 ¶
DecodeInt64 takes a byte slice and decodes it into an int64.
func DecodeUint64 ¶
DecodeUint64 takes a byte slice and decodes it into a uint64.
Types ¶
This section is empty.