Skip to main content

exceeds_maximum_length_ratio

Test that value is within a reasonable range of password.

def exceeds_maximum_length_ratio(
password: string,
max_similarity: float,
value: string
) - > boolean

Test that value is within a reasonable range of password.

Parameters

NameTypeDescription
passwordstringThe reference password string used to establish the baseline length for comparison.
max_similarityfloatThe maximum allowed similarity threshold used to calculate the length-based similarity bound.
valuestringThe input string being tested to determine if its length relative to the password precludes it from exceeding the similarity limit.

Returns

TypeDescription
booleanTrue if the length ratio between the password and the value is large enough to mathematically guarantee the similarity score cannot exceed the maximum threshold, False otherwise.