func Commit
Commit returns the commitment for payload under salt: the lowercase hex encoding of SHA-256(salt + ":" + payload).
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package commitreveal implements a minimal commit-reveal scheme.
Package commitreveal implements a minimal commit-reveal scheme.
A commitment is the hex-encoded SHA-256 of the exact byte string
1salt + ":" + payload
The payload stays secret until the revealer publishes payload and salt; anyone can then recompute the commitment and check it matches the value that was committed earlier. The salt keeps short or guessable payloads from being brute-forced against a bare hash of the payload alone.
The package is pure and stateless: it is safe to import from any realm.
Commit returns the commitment for payload under salt: the lowercase hex encoding of SHA-256(salt + ":" + payload).
IsCommitment reports whether s has the canonical commitment format: exactly 64 lowercase hexadecimal characters.
Verify reports whether commitment is well-formed and equals the commitment recomputed from payload and salt.