A hash describes input; a UUID names a record
SHA-256 deterministically maps the same byte sequence to the same 256-bit digest. UUIDv4 uses random or pseudorandom bits to create a 128-bit identifier with extremely low collision probability. One is content-derived; the other is intentionally independent of content.
Choose a hash when identical normalized input should produce an identical value. Choose a UUID when separate clients need to create record identifiers without asking a central counter for the next number.
Byte-for-byte details matter for hashing
Text must be encoded into bytes before hashing. UTF-8 is a sensible default, but line endings, trailing whitespace and Unicode normalization can still change the digest. Document the exact preprocessing rules when two systems must agree.
- Preserve or remove final newlines deliberately
- Agree on UTF-8
- Do not lowercase content unless the protocol requires it
- Compare lowercase and uppercase hex as representations of the same bytes
Neither value grants security by itself
A UUID is not an authorization token merely because it is difficult to guess. A plain SHA-256 digest is not suitable for password storage because attackers can test guesses quickly. Access control still needs authenticated permission checks, and passwords need a slow salted password-hashing function.
Choose the UUID version for the data model
UUIDv4 is appropriate for random identifiers and is what the XXF generator creates. RFC 9562 also defines UUIDv7, which includes Unix-epoch time for sortable identifiers. Do not silently change versions when downstream systems validate a specific layout.
Reproduce a digest with a known three-byte input
Enter exactly abc, with no newline, into SHA-256 Hash Generator. The digest below is deterministic. Add a newline and the input becomes four bytes, producing a different digest. This is a useful way to diagnose disagreement between an editor, a command-line pipeline and a browser tool.
Generate two batches in UUID Generator instead. The identifiers should change between runs; their version digit is 4 and their variant digit is 8, 9, a or b. Do not compare a random batch to a fixed expected list. The layout check confirms representation, not permission or ownership.
abcba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015adprintf %s abc | shasum -a 256Choose preprocessing before comparing results
The hash tool encodes the entered text as UTF-8 without stripping whitespace or normalizing Unicode. Visually similar text can therefore have different bytes. Establish whether the protocol preserves line endings, trims final newlines or normalizes text before either side calculates a digest.
A digest is useful for integrity comparison only when the expected value comes from a trusted source. An attacker who can replace both a file and its published hash can make them agree. For passwords, use a dedicated salted password-hashing scheme; for authorization, check authenticated permissions rather than treating an unpredictable UUID as access control.
- Keep exact input bytes reproducible
- Specify any text normalization
- Obtain comparison digests from a trusted channel
- Use UUIDs as identifiers, not access grants
Read the specification
Put the guide into practice
Open the related browser tools and test the workflow with a synthetic sample