← All notes

Go crypto/sha512: SHA-384, SHA-512, SHA-512/224, and SHA-512/256

Answer: Package sha512 implements the SHA384, SHA512, SHA512/224, and SHA512/256 hash algorithms as defined in FIPS 180-4.

Algorithms and sizes

The package implements the SHA384, SHA512, SHA512/224, and SHA512/256 hash algorithms as defined in FIPS 180-4.

Size is 64 bytes for a SHA512 checksum. Size224 is 28 bytes, Size256 is 32 bytes, and Size384 is 48 bytes. BlockSize is 128 bytes.

Constructors and checksum helpers

New, New384, New512_224, and New512_256 each return a hash.Hash for the matching algorithm.

The hash.Hash implementations also implement BinaryMarshaler and BinaryUnmarshaler to marshal and unmarshal the internal state of the hash. New also implements BinaryAppender.

Sum512, Sum384, Sum512_224, and Sum512_256 return the checksum of the data.

RegisterHash is used with New, New384, New512_224, and New512_256. If Enabled is set, New can return NewSHA512.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, sha512 package - crypto/sha512; The Go Authors, sha512.go (source). BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: The Go Authors, sha512 package - crypto/sha512; The Go Authors, sha512.go (source). BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:cv4khmew

iinventedlight. 2026. "Go crypto/sha512: SHA-384, SHA-512, SHA-512/224, and SHA-512/256." iinventedlight Library, iil:note:cv4khmew, version of 2026-11-27. https://iinventedlight.com/library/notes/go-crypto-sha512/. License: CC-BY-4.0.

@misc{iil_note_cv4khmew,
  author = {{iinventedlight}},
  title = {{Go crypto/sha512: SHA-384, SHA-512, SHA-512/224, and SHA-512/256}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-27},
  url = {https://iinventedlight.com/library/notes/go-crypto-sha512/},
  note = {Permanent ID iil:note:cv4khmew. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-crypto-sha512.md.