package bytehelper
import "go.mau.fi/libsignal/util/bytehelper"
Index ¶
- func ArrayToSlice(bytes [32]byte) []byte
- func ArrayToSlice64(bytes [64]byte) []byte
- func Bytes5ToInt64(bytes []byte, offset int) int64
- func CopySlice(bytes []byte) []byte
- func SliceToArray(bytes []byte) [32]byte
- func SliceToArray64(bytes []byte) [64]byte
- func Split(input []byte, firstLength, secondLength int) [][]byte
- func SplitThree(input []byte, firstLength, secondLength, thirdLength int) ([][]byte, error)
- func Trim(input []byte, length int) []byte
Functions ¶
func ArrayToSlice ¶
ArrayToSlice will convert a 32 byte array to byte slice
func ArrayToSlice64 ¶
ArrayToSlice64 will convert a 64 byte array to byte slice
func Bytes5ToInt64 ¶
Bytes5ToInt64 will convert the given byte array and offset to an int64.
func CopySlice ¶
CopySlice returns a copy of the given bytes.
func SliceToArray ¶
SliceToArray will convert byte slice to a 32 byte array
func SliceToArray64 ¶
SliceToArray64 will convert byte slice to a 64 byte array
func Split ¶
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 ¶
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 ¶
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.