bytehelper

package
v0.0.0-...-d09bcab Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2017 License: GPL-3.0 Imports: 1 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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