多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# package sha256 `import "crypto/sha256"` sha256包实现了SHA224和SHA256哈希算法,参见FIPS 180-4。 ## Index * [Constants](#pkg-constants) * [func Sum256(data []byte) [Size]byte](#Sum256) * [func New() hash.Hash](#New) * [func Sum224(data []byte) (sum224 [Size224]byte)](#Sum224) * [func New224() hash.Hash](#New224) ## Constants ``` const BlockSize = 64 ``` SHA224和SHA256的字节块大小。 ``` const Size = 32 ``` SHA256校验和的字节长度。 ``` const Size224 = 28 ``` SHA224校验和的字节长度。 ## func [Sum256](https://github.com/golang/go/blob/master/src/crypto/sha256/sha256.go#L177 "View Source") ``` func Sum256(data []byte) [Size]byte ``` 返回数据的SHA256校验和。 ## func [New](https://github.com/golang/go/blob/master/src/crypto/sha256/sha256.go#L82 "View Source") ``` func New() hash.Hash ``` 返回一个新的使用SHA256校验算法的hash.Hash接口。 ## func [Sum224](https://github.com/golang/go/blob/master/src/crypto/sha256/sha256.go#L185 "View Source") ``` func Sum224(data []byte) (sum224 [Size224]byte) ``` 返回数据的SHA224校验和。 ## func [New224](https://github.com/golang/go/blob/master/src/crypto/sha256/sha256.go#L89 "View Source") ``` func New224() hash.Hash ``` 返回一个新的使用SHA224校验算法的hash.Hash接口。