bytehelper

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesPrefix

func BytesPrefix(prefix []byte) ([]byte, []byte)

BytesPrefix returns key range that satisfy the given prefix. This only applicable for the standard 'bytes comparer'.

func BytesToInt

func BytesToInt(b []byte) (int32, error)

BytesToInt le bytes to int32, little endian

func BytesToInt64

func BytesToInt64(b []byte) (int64, error)

BytesToInt64 le bytes to int64, little endian

func BytesToString added in v2.2.0

func BytesToString(b []byte) string

BytesToString converts byte slice to string without a memory allocation.

func BytesToUint64

func BytesToUint64(b []byte) (uint64, error)

BytesToUint64 le bytes to uint64, little endian

func Int64ToBytes

func Int64ToBytes(x int64) ([]byte, error)

Int64ToBytes int64 to le bytes, little endian

func IntToBytes

func IntToBytes(x int32) []byte

IntToBytes int32 to le bytes, little endian

func StringToBytes added in v2.2.0

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice without a memory allocation.

func Uint64ToBytes

func Uint64ToBytes(x uint64) ([]byte, error)

Uint64ToBytes uint64 to le bytes, little endian

Types

This section is empty.

Jump to

Keyboard shortcuts

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