Standard library / crypto

crypto.Hash.Available()

Report whether the algorithm has a registered implementation in this executable. Import the relevant package; availability is not a security recommendation. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (h Hash) Available() bool

Return Value

bool

Whether the constructor is registered.

Working Example

Example Snippetgo
package main
import (  "crypto"  _ "crypto/sha256"  "fmt")
func main() { fmt.Println(crypto.SHA256.Available()) }
Go Reference