Black Lives Matter. Support the Equal Justice Initiative.

Package sha512

import "crypto/sha512"
Overview
Index

Overview ▾

软件包sha512实现了FIPS 180-4中定义的SHA-384,SHA-512,SHA-512 / 224和SHA-512 / 256哈希算法.

此包返回的所有hash.Hash实现也都实现encoding.BinaryMarshaler和encoding.BinaryUnmarshaler来封送和取消封送哈希的内部状态.

Constants

const (
    // Size is the size, in bytes, of a SHA-512 checksum.
    Size = 64

    // Size224 is the size, in bytes, of a SHA-512/224 checksum.
    Size224 = 28

    // Size256 is the size, in bytes, of a SHA-512/256 checksum.
    Size256 = 32

    // Size384 is the size, in bytes, of a SHA-384 checksum.
    Size384 = 48

    // BlockSize is the block size, in bytes, of the SHA-512/224,
    // SHA-512/256, SHA-384 and SHA-512 hash functions.
    BlockSize = 128
)

func New

func New() hash.Hash

New返回一个新的哈希值,哈希值计算SHA-512校验和.

func New384

func New384() hash.Hash

New384返回一个新的哈希值,哈希值计算SHA-384校验和.

func New512_224 1.5

func New512_224() hash.Hash

New512_224返回一个新的哈希值,哈希值将计算SHA-512 / 224校验和.

func New512_256 1.5

func New512_256() hash.Hash

New512_256返回一个新的哈希值,该哈希值计算SHA-512 / 256校验和.

func Sum384 1.2

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

Sum384返回数据的SHA384校验和.

func Sum512 1.2

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

Sum512返回数据的SHA512校验和.

func Sum512_224 1.5

func Sum512_224(data []byte) (sum224 [Size224]byte)

Sum512_224返回数据的Sum512 / 224校验和.

func Sum512_256 1.5

func Sum512_256(data []byte) (sum256 [Size256]byte)

Sum512_256返回数据的Sum512 / 256校验和.

by  ICOPY.SITE