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

needsRehash

static fun needsRehash(hash: String!): Boolean (source)

Check if a hash needs to be regenerated using limits on operations and memory that are suitable for most use-cases.

Equivalent to needsRehash(hash, moderateOpsLimit(), moderateMemLimit()).

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

Parameters

hash - String!: The hash.

Return
Boolean: true if the hash should be regenerated.

static fun needsRehash(hash: String!, opsLimit: Long, memLimit: Long): Boolean (source)

Check if a hash needs to be regenerated.

Check if a hash matches the parameters opslimit and memlimit, and the current default algorithm.

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

Parameters

hash - String!: The hash.

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
Boolean: true if the hash should be regenerated.