util

package
v0.0.0-...-fc0aef5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidChecksum = errors.New("Invalid checksum")

Functions

func HMAC512Split

func HMAC512Split(key, seed []byte) ([]byte, []byte)

HMAC512Split computes an HMAC using SHA512 for a given key and seed, splitting the digest into left and right byte slices.

func Hash256d

func Hash256d(data []byte) []byte

Hash256d computes the double SHA256 of data.

func HexChecksumDecode

func HexChecksumDecode(s string, checksumSize int) ([]byte, error)

HexChecksumDecode decodes a hexidecimal string, verifies the 4 byte checksum and returns the decoded byte slice.

func HexChecksumEncode

func HexChecksumEncode(b []byte, checksumSize int) string

HexChecksumEncode appends a 4 byte SHA256d checksum to the byte slice and returns the hexidecimal encoding.

func OrSlice

func OrSlice(a []byte) byte

OrSlice takes the cumulative OR of all bytes in a byte slice. This method is useful for determining whether or not a byte slice has been zeroed.

func PaddedCopy

func PaddedCopy(dst, src []byte, size uint)

Copies at most size bytes from src to dst, offset by the difference between size and len(src).

func Zero

func Zero(b []byte)

Zero sets all bytes in a byte slice to zero.

Types

This section is empty.

Jump to

Keyboard shortcuts

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