salt.append(random.randint(0, 255))
return _bytes_to_text(_pack_bytes(salt))[:salt_len]
salt.append(random.randint(0, 255))
return _bytes_to_text(_pack_bytes(salt))[:salt_len]
legacy_hash), "Not a valid MD5 hexdigest"
# this needs to be declared as b"" in 2to3
collapsed = ""
legacy_hash), "Not a valid MD5 hexdigest"
# this needs to be declared as b"" in 2to3
collapsed = ""
# this needs to become a byte() call in 2to3
collapsed += chr(int(legacy_hash[2 * i:2 * i + 2], 16))
return "%s%s%s%s%s%s%s%s" % (
# this needs to become a byte() call in 2to3
collapsed += chr(int(legacy_hash[2 * i:2 * i + 2], 16))
return "%s%s%s%s%s%s%s%s" % (
hashed = algorithms[algorithm](hashed).digest()
# concatenate the output fields, coercing into text form as needed
hashed = algorithms[algorithm](hashed).digest()
# concatenate the output fields, coercing into text form as needed