blake2b - ActiveState ActiveGo 1.8
...

Package blake2b

import "golang.org/x/crypto/blake2b"
Overview
Index

Overview ▾

Package blake2b implements the BLAKE2b hash algorithm as defined in RFC 7693.

Constants

const (
    // The blocksize of BLAKE2b in bytes.
    BlockSize = 128
    // The hash size of BLAKE2b-512 in bytes.
    Size = 64
    // The hash size of BLAKE2b-384 in bytes.
    Size384 = 48
    // The hash size of BLAKE2b-256 in bytes.
    Size256 = 32
)

func New256

func New256(key []byte) (hash.Hash, error)

New256 returns a new hash.Hash computing the BLAKE2b-256 checksum. A non-nil key turns the hash into a MAC. The key must between zero and 64 bytes long.

func New384

func New384(key []byte) (hash.Hash, error)

New384 returns a new hash.Hash computing the BLAKE2b-384 checksum. A non-nil key turns the hash into a MAC. The key must between zero and 64 bytes long.

func New512

func New512(key []byte) (hash.Hash, error)

New512 returns a new hash.Hash computing the BLAKE2b-512 checksum. A non-nil key turns the hash into a MAC. The key must between zero and 64 bytes long.

func Sum256

func Sum256(data []byte) [Size256]byte

Sum256 returns the BLAKE2b-256 checksum of the data.

func Sum384

func Sum384(data []byte) [Size384]byte

Sum384 returns the BLAKE2b-384 checksum of the data.

func Sum512

func Sum512(data []byte) [Size]byte

Sum512 returns the BLAKE2b-512 checksum of the data.