Categorygithub.com/wealdtech/go-bytesutil
modulepackage
1.2.1
Repository: https://github.com/wealdtech/go-bytesutil.git
Documentation: pkg.go.dev

# README

go-bytesutil

Tag License GoDoc Travis CI codecov.io

Go library providing common byte manipulation utilities.

Table of Contents

Install

go-bytesutil is a standard Go module which can be installed with:

go get github.com/wealdtech/go-bytesutil

Usage

Documentation is at https://godoc.org/github.com/wealdtech/go-bytesutil

Example

Maintainers

Jim McDonald: @mcdee.

Contribute

Contributions welcome. Please check out the issues.

License

Apache-2.0 © 2019 Weald Technology Trading Ltd

# Functions

Bytes1 returns the first byte of the little-endian representation of the supplied value.
Bytes16 returns the first sixteen bytes of the little-endian representation of the supplied value.
Bytes2 returns the first two bytes of the little-endian representation of the supplied value.
Bytes32 returns the first thirty-two bytes of the little-endian representation of the supplied value.
Bytes4 returns the first four bytes of the little-endian representation of the supplied value.
Bytes64 returns the first thirty-two bytes of the little-endian representation of the supplied value.
Bytes8 returns the first eight bytes of the little-endian representation of the supplied value.
FromHexString returns a byte array given a hex string.
ToBytes16 returns a 16-byte array with the supplied value placed in the low-order indices.
ToBytes32 returns a 32-byte array with the supplied value placed in the low-order indices.
ToBytes48 returns a 48-byte array with the supplied value placed in the low-order indices.
ToBytes64 returns a 64-byte array with the supplied value placed in the low-order indices.
ToBytes8 returns an 8-byte array with the supplied value placed in the low-order indices.
ToBytes96 returns a 96-byte array with the supplied value placed in the low-order indices.
XOR returns an XORd copy of the bytes.