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