libsignalgo.mau.fi/libsignal/util/bytehelper Index | Files

package bytehelper

import "go.mau.fi/libsignal/util/bytehelper"

Index

Functions

func ArrayToSlice

func ArrayToSlice(bytes [32]byte) []byte

ArrayToSlice will convert a 32 byte array to byte slice

func ArrayToSlice64

func ArrayToSlice64(bytes [64]byte) []byte

ArrayToSlice64 will convert a 64 byte array to byte slice

func Bytes5ToInt64

func Bytes5ToInt64(bytes []byte, offset int) int64

Bytes5ToInt64 will convert the given byte array and offset to an int64.

func CopySlice

func CopySlice(bytes []byte) []byte

CopySlice returns a copy of the given bytes.

func SliceToArray

func SliceToArray(bytes []byte) [32]byte

SliceToArray will convert byte slice to a 32 byte array

func SliceToArray64

func SliceToArray64(bytes []byte) [64]byte

SliceToArray64 will convert byte slice to a 64 byte array

func Split

func Split(input []byte, firstLength, secondLength int) [][]byte

Split will take the given byte array and split it into half, with the first half being "firstLength" in size and the second half "secondLength" in size.

func SplitThree

func SplitThree(input []byte, firstLength, secondLength, thirdLength int) ([][]byte, error)

SplitThree will take the given byte array and split it into thirds, with the first third being "firstLength" in size, the second third being "secondLength" in size, and the last third being "thirdLength" in size.

func Trim

func Trim(input []byte, length int) []byte

Trim will trim the given byte array to the given length.

Source Files

ByteHelper.go

Version
v0.1.2 (latest)
Published
Feb 12, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
1 week ago

Tools for package owners.