Skip to main content

must_update_salt

Determines if a salt needs updating by calculating its current entropy based on length and character set, then comparing it against a required entropy threshold.

def must_update_salt(
salt: string,
expected_entropy: float
) - > boolean

Determines if the current salt provides insufficient entropy based on a required threshold.

Parameters

NameTypeDescription
saltstringThe existing salt string whose entropy is being evaluated.
expected_entropyfloatThe minimum required bits of entropy the salt must satisfy.

Returns

TypeDescription
booleanTrue if the calculated entropy of the salt is less than the expected entropy, indicating an update is necessary.