Util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2018 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(errs []error) error

CheckError will return error if one of the input is non-nil.

func CreateHash

func CreateHash(size int, messagebyte ...[]byte) []byte

CreateHash returns the Blake2b hash of message with specified size.

func CreateKeyedHash

func CreateKeyedHash(size int, key []byte, messagebyte ...[]byte) []byte

CreateHash returns the Blake2b hash of message with specified size.

func CreateKeyedXOFHash

func CreateKeyedXOFHash(size uint32, key []byte, messagebyte ...[]byte) []byte

CreateKeyedXOFHash returns the Blake2b-XOF hash of message using an secret-key, with specified size.

func ExistEmpty

func ExistEmpty(s ...string) bool

ExistEmpty will return true if one of the input is empty.

func ReverseBytes

func ReverseBytes(b []byte) []byte

func SecureHexDecode

func SecureHexDecode(s string) (r []byte, ok bool)

SecureHexDecode decodes an byte without table-lookup. It's results the byte-array of decoded hex.

func SecureHexEncode

func SecureHexEncode(b []byte) string

SecureHexEncode decodes an byte without table-lookup. It's results the hexadecimal string representation.

func StringIsNumeric

func StringIsNumeric(s string) (ok bool)

StringIsNumeric return false if the input is not between 0 to 9.

func UnsafeBase32Decode

func UnsafeBase32Decode(src string) ([]byte, error)

UnsafeBase32Decode decodes an string in non-constant time. It's results the bytes of decoded Base32.

func UnsafeBase32Encode

func UnsafeBase32Encode(src []byte) string

UnsafeBase32Encode encodes an byte in non-constant time. It's results the Base32 string.

func UnsafeHexDecode

func UnsafeHexDecode(s string) ([]byte, error)

UnsafeHexDecode decodes an byte without table-lookup. It's results the byte-array of decoded hex.

func UnsafeHexEncode

func UnsafeHexEncode(b []byte) string

UnsafeBase32Encode encodes an byte in non-constant time. It's results the Base32 string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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