bytes

package
v0.0.0-...-68fec7b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add128

func Add128(sum, a, b []byte) (carry byte, err error)

Add the first 16 bytes of two byte arrays as if they're 128bit integers in platform endian format

func Add128BE

func Add128BE(sum, a, b []byte) (carry byte, err error)

Add the first 16 bytes of two slices together into sum (which must have space), as if they're 128 bit big endian integers. - `a` or `b` can have less than 16 bytes of content and will be zero padded (at the end). - `carry` will only contain a 0 or 1

func Add128LE

func Add128LE(sum, a, b []byte) (carry byte, err error)

Add the first 16 bytes of two slices together into sum (which must have space), as if they're 128 bit little endian integers. - `a` or `b` can have less than 16 bytes of content and will be zero padded (at the end). - `carry` will only contain a 0 or 1

func Add16

func Add16(sum, a, b []byte) (carry byte, err error)

Add the first 2 bytes of two byte arrays as if they're 16bit integers in platform endian format

func Add16BE

func Add16BE(sum, a, b []byte) (carry byte, err error)

Add the first 2 bytes of two slices together into sum (which must have space), as if they're 16 bit big endian integers. - `a` or `b` can have less than 2 bytes of content and will be zero padded (at the end) - `carry` will only contain a 0 or 1

func Add16LE

func Add16LE(sum, a, b []byte) (carry byte, err error)

Add the first 2 bytes of two slices together into sum (which must have space), as if they're 16 bit little endian integers. - `a` or `b` can have less than 2 bytes of content and will be zero padded (at the end) - `carry` will only contain a 0 or 1

func Add256

func Add256(sum, a, b []byte) (carry byte, err error)

Add the first 32 bytes of two byte arrays as if they're 256bit integers in platform endian format

func Add256BE

func Add256BE(sum, a, b []byte) (carry byte, err error)

Add the first 32 bytes of two slices together into sum (which must have space), as if they're 256 bit big endian integers. - `a` or `b` can have less than 32 bytes of content and will be zero padded (at the end). - `carry` will only contain a 0 or 1

func Add256LE

func Add256LE(sum, a, b []byte) (carry byte, err error)

Add the first 32 bytes of two slices together into sum (which must have space), as if they're 256 bit little endian integers. - `a` or `b` can have less than 32 bytes of content and will be zero padded (at the end). - `carry` will only contain a 0 or 1

func Add32

func Add32(sum, a, b []byte) (carry byte, err error)

Add the first 4 bytes of two byte arrays as if they're 32bit integers in platform endian format

func Add32BE

func Add32BE(sum, a, b []byte) (carry byte, err error)

Add the first 4 bytes of two slices together into sum (which must have space), as if they're 32 bit big endian integers. - `a` or `b` can have less than 4 bytes of content and will be zero padded (at the end) - `carry` will only contain a 0 or 1

func Add32LE

func Add32LE(sum, a, b []byte) (carry byte, err error)

Add the first 4 bytes of two slices together into sum (which must have space), as if they're 32 bit little endian integers. - `a` or `b` can have less than 4 bytes of content and will be zero padded (at the end) - `carry` will only contain a 0 or 1

func Add512

func Add512(sum, a, b []byte) (carry byte, err error)

Add the first 64 bytes of two byte arrays as if they're 512bit integers in platform endian format

func Add512BE

func Add512BE(sum, a, b []byte) (carry byte, err error)

Add the first 64 bytes of two slices together into sum (which must have space), as if they're 512 bit big endian integers. - `a` or `b` can have less than 64 bytes of content and will be zero padded (at the end). - `carry` will only contain a 0 or 1

func Add512LE

func Add512LE(sum, a, b []byte) (carry byte, err error)

Add the first 64 bytes of two slices together into sum (which must have space), as if they're 512 bit little endian integers. - `a` or `b` can have less than 64 bytes of content and will be zero padded (at the end). - `carry` will only contain a 0 or 1

func Add64

func Add64(sum, a, b []byte) (carry byte, err error)

Add the first 8 bytes of two byte arrays as if they're 64bit integers in platform endian format

func Add64BE

func Add64BE(sum, a, b []byte) (carry byte, err error)

Add the first 8 bytes of two slices together into sum (which must have space), as if they're 64 bit big endian integers. - `a` or `b` can have less than 8 bytes of content and will be zero padded (at the end). - `carry` will only contain a 0 or 1

func Add64LE

func Add64LE(sum, a, b []byte) (carry byte, err error)

Add the first 8 bytes of two slices together into sum (which must have space), as if they're 64 bit little endian integers. - `a` or `b` can have less than 8 bytes of content and will be zero padded (at the end). - `carry` will only contain a 0 or 1

func XorEq

func XorEq(dst, other []byte) (n int)

XORs elements from `other` into `dst`. Returns the number of elements XORed, which will be the minimum of len(dst) len(other) dst ^= other

func Zero

func Zero(target []byte)

Zero the content of a slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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