binarysort

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2021 License: MIT Imports: 5 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendBase64

func AppendBase64(buf []byte, data []byte) ([]byte, error)

AppendBase64 encodes data into a custom base64 encoding. The resulting slice respects natural sort-ordering.

func AppendBool

func AppendBool(buf []byte, x bool) []byte

AppendBool takes a bool and returns its binary representation.

func AppendFloat64

func AppendFloat64(buf []byte, x float64) []byte

AppendFloat64 takes an float64 and returns its binary representation.

func AppendInt64

func AppendInt64(buf []byte, x int64) []byte

AppendInt64 takes an int64 and returns its binary representation.

func AppendUint64

func AppendUint64(buf []byte, x uint64) []byte

AppendUint64 takes an uint64 and returns its binary representation.

func DecodeBase64

func DecodeBase64(data []byte) ([]byte, error)

DecodeBase64 decodes a custom base64 encoded byte slice, encoded with AppendBase64.

func DecodeBool

func DecodeBool(buf []byte) (bool, error)

DecodeBool takes a byte slice and decodes it into a boolean.

func DecodeFloat64

func DecodeFloat64(buf []byte) (float64, error)

DecodeFloat64 takes a byte slice and decodes it into an float64.

func DecodeInt64

func DecodeInt64(buf []byte) (int64, error)

DecodeInt64 takes a byte slice and decodes it into an int64.

func DecodeUint64

func DecodeUint64(buf []byte) (uint64, error)

DecodeUint64 takes a byte slice and decodes it into a uint64.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL