crypto
type Hash
type Hash uintconst (MD4 Hash = 1 + iota // 导入code.google.com/p/go.crypto/md4MD5 // 导入crypto/md5SHA1 // 导入crypto/sha1SHA224 // 导入crypto/sha256SHA256 // 导入crypto/sha256SHA384 // 导入crypto/sha512SHA512 // 导入crypto/sha512MD5SHA1 // 未实现;MD5+SHA1用于TLS RSARIPEMD160 // 导入code.google.com/p/go.crypto/ripemd160)
func (h Hash) Available() bool 报告是否有hash函数注册到该标识值
func (h Hash) Size() int 返回给定hash函数返回值的字节长度
- 创建一个使用给定hash函数的hash.Hash接口,如果该标识值未注册hash函数,将会panic
func RegisterHash(h Hash, f func() hash.Hash)
- 注册一个返回给定hash接口实例的函数,并指定其标识值,该函数应在实现hash接口的包的init函数中调用
