package main import ( "fmt" "hash/fnv" ) func main() { h := fnv.New128a() fmt.Printf("Size of FNV hash: %v bytes\n", h.Size()) }
package main import ( "crypto/sha256" "fmt" ) func main() { h := sha256.New() fmt.Printf("Size of SHA256 hash: %v bytes\n", h.Size()) }In this example, we are importing the `crypto/sha256` package to create a new SHA256 hash function by calling `sha256.New()`. Then, we are printing the size of the hash function in bytes using the `Size()` method. Package Library: `hash/fnv` - Package fnv implements FNV-1 and FNV-1a non-cryptographic hash functions. Package Library: `crypto/sha256` - Package sha256 implements the SHA-224, SHA-256, SHA-384, and SHA-512 hash algorithms as defined in FIPS 180-4.