Documentation
¶
Overview ¶
Package lthn implements the LTHN quasi-salted hash algorithm (RFC-0004).
LTHN produces deterministic, verifiable hashes without requiring separate salt storage. The salt is derived from the input itself through:
- Reversing the input string
- Applying "leet speak" style character substitutions
The final hash is: SHA256(input || derived_salt)
This is suitable for content identifiers, cache keys, and deduplication. NOT suitable for password hashing - use bcrypt, Argon2, or scrypt instead.
Example:
hash := lthn.Hash("hello")
valid := lthn.Verify("hello", hash) // true
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hash ¶
Hash computes the LTHN hash of the input string.
The algorithm:
- Derive a quasi-salt by reversing the input and applying character substitutions
- Concatenate: input + salt
- Compute SHA-256 of the concatenated string
- Return the hex-encoded digest (64 characters, lowercase)
The same input always produces the same hash, enabling verification without storing a separate salt value.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.