Standard library / crypto/sha512
crypto/sha512.New512_256()
Create an incremental SHA512/256 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: '53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23\n'.
Formal Syntax & Structure
go syntaxgo
func New512_256() hash.HashReturn Value
hash.Hash
Fresh SHA512/256 hash instance.
Working Example
Example Snippetgo
package main
import ( "crypto/sha512" "fmt")
func main() { h := sha512.New512_256() h.Write([]byte("a")) h.Write([]byte("bc")) fmt.Printf("%x\n", h.Sum(nil))}