Standard library / crypto
crypto.Hash
Typed identifier for a hash algorithm. Size is digest length; Available checks whether its constructor has been linked. Expected stdout: '32 true\n'.
Formal Syntax & Structure
go syntaxgo
type Hash uintWorking Example
Example Snippetgo
package main
import ( "crypto" _ "crypto/sha256" "fmt")
func main() { var h crypto.Hash = crypto.SHA256; fmt.Println(h.Size(), h.Available()) }