Documentation ¶
Overview ¶
Package sha256key provides access to the hash function used to make content-addressable keys.
Index ¶
Constants ¶
const Size = sha256.Size
Size is the number of bytes in a hash.
Variables ¶
This section is empty.
Functions ¶
func BytesString ¶
BytesString returns a string representation of the hash that is represented in bytes.
Types ¶
type Hash ¶
Hash represents a SHA-256 hash code. It is always 32 bytes long. Its representation is an array so it can be treated as a value.
var ZeroHash Hash
ZeroHash is the zero-valued hash.
func Of ¶
Of returns the SHA-256 hash of the data, as a Hash. The odd name works well in the client: sha256key.Of.
func Parse ¶
Parse returns the hash whose standard format (possibly absent the brackets) is the value of str.
func (Hash) EqualString ¶
EqualString compares the byte-level representation of a hash with its hex string representation, avoiding allocation.