Skip to main content

constant_time_compare

Return True if the two strings are equal, False otherwise.

def constant_time_compare(
val1: string|bytes,
val2: string|bytes
) - > boolean

Return True if the two strings are equal, False otherwise.

Parameters

NameTypeDescription
val1`stringbytes`
val2`stringbytes`

Returns

TypeDescription
booleanTrue if the provided values are identical after being converted to bytes, False otherwise