docs/api/exposed-crypt/org.jetbrains.exposed.v1.crypt/-hashed/index.html
class Hashed(hasher: Hasher, val encodedValue: String)
A hashed column holds these rather than strings, which is what keeps a plaintext value from being stored in one by accident, or compared against one in SQL. Assigning a Hashed read from the database back to a column stores it unchanged, without hashing it a second time.
Constructing one directly wraps encodedValue as it is, without hashing it. Do that to adopt hashes produced elsewhere, such as when migrating existing values into a hashed column; to hash a plaintext value, use Hasher.hash.
Members
Link copied to clipboard
constructor(hasher: Hasher, encodedValue: String)
Link copied to clipboard
val encodedValue: String
The encoded hash, as stored in the database.
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun matches(plainText: String): Boolean
Returns whether plainText hashes to this value, as determined by the Hasher that produced it.
Link copied to clipboard
open override fun toString(): String
Generated by Dokka © 2026 Copyright