Standard library / crypto/sha256

crypto/sha256.New224()

Create an incremental SHA224 hash. Write accepts successive chunks; Sum appends the digest without consuming the hash state. A digest alone does not authenticate data; use HMAC or a signature where appropriate. Not a password hashing scheme. Expected stdout: '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7\n'.

Formal Syntax & Structure

go syntaxgo
func New224() hash.Hash

Return Value

hash.Hash

Fresh SHA224 hash instance.

Working Example

Example Snippetgo
package main
import (  "crypto/sha256"  "fmt")
func main() {  h := sha256.New224()  h.Write([]byte("a"))  h.Write([]byte("bc"))  fmt.Printf("%x\n", h.Sum(nil))}
Go Reference