tuweni / org.apache.tuweni.crypto.sodium / PasswordHash / checkHash

checkHash

static fun checkHash(hash: String!, password: String!): VerificationResult! (source)

Verify a password against a hash and check the hash is suitable for normal use-cases.

Equivalent to verify(hash, password, moderateOpsLimit(), moderateMemLimit()).

Note: only supported when the sodium native library version >= 10.0.14 is available.

Parameters

hash - String!: The hash.

password - String!: The password to verify.

Return
VerificationResult!: The result of verification.

static fun checkHash(hash: String!, password: String!, opsLimit: Long, memLimit: Long): VerificationResult! (source)

Verify a password against a hash.

Note: only supported when the sodium native library version >= 10.0.14 is available.

Parameters

hash - String!: The hash.

password - String!: The password to verify.

opsLimit - Long: The operations limit, which must be in the range #minOpsLimit() to #maxOpsLimit().

memLimit - Long: The memory limit, which must be in the range #minMemLimit() to #maxMemLimit().

Return
VerificationResult!: The result of verification.