Documentation ¶
Index ¶
- func BytesToNibbles(byts []byte) []byte
- func CoalesceBytes(a []byte, others ...[]byte) []byte
- func CoalesceString(a string, others ...string) string
- func IndentString(text string, indentation string) string
- func InvertBits(data []byte) []byte
- func NibblesToBytes(nibbles []byte) []byte
- func NibblesToHex(nibbles []byte) string
- func Pad80(data []byte, skipIfExact bool) []byte
- func PadLeft(data []byte, padbyte byte, totalLength int) []byte
- func PadRight(data []byte, padbyte byte, totalLength int) []byte
- func ParseHexNibbles(src string) ([]byte, error)
- func SetNibble(slice []byte, index int, nibble uint8)
- func TruncateLeft(data []byte, totalLength int) []byte
- func TruncateRight(data []byte, totalLength int) []byte
- func XOR(a []byte, others ...[]byte) []byte
- func XORInPlace(data, other []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToNibbles ¶ added in v0.0.3
func CoalesceBytes ¶ added in v0.0.3
func CoalesceString ¶ added in v0.0.3
func IndentString ¶
func InvertBits ¶ added in v0.0.3
func NibblesToBytes ¶ added in v0.0.3
func NibblesToHex ¶ added in v0.0.3
func Pad80 ¶ added in v0.0.3
Pad80 pads the data with byte 0x80 and then 0x00s until the data is an exact multiple of the block size.
`skipIfExact` controls if an entire block should be added when the data is an exact multiple of the block size or if the padding should be skipped entirely.
func ParseHexNibbles ¶ added in v0.0.3
func TruncateLeft ¶ added in v0.0.3
TruncateLeft discards bytes at the left until the length is equal the specified. If the length of the data is already equal to or shorter than `totalLength`, the data will be returned unchanged.
func TruncateRight ¶ added in v0.0.3
TruncateRight discards bytes at the right until the length is equal the specified. If the length of the data is already equal to or shorter than `totalLength`, the data will be returned unchanged.
func XOR ¶ added in v0.0.3
XOR performs an Exclusive Or operation on the data and returns a slice with the results. This function does not mutate the slices fed into it.
If the length of `other` is smaller than the length of `a`, it will be padded to the left, adding zeroes to the left of b. If the length of `other` is greater than the length of `a`, it will be truncated to the left, removing the most significant bits.
func XORInPlace ¶ added in v0.0.3
func XORInPlace(data, other []byte)
XORInPlace performs an Exclusive Or operation on the data mutating it.
If the length of `other` is smaller than the length of `data`, it will be truncated to the left, removing the most significant bits. If the length of `other` is greater than the length of `data`, it will be padded to the left, adding zeroes to the left.
Types ¶
This section is empty.