Attempt #2: Update gyb to latest version and use python3

This commit is contained in:
Matt Meissner
2022-02-13 22:10:36 -06:00
committed by Maurice Parker
parent 5f5fc2ad4f
commit 54623ec421
3 changed files with 37 additions and 33 deletions

View File

@@ -8,14 +8,14 @@ def chunks(seq, size):
return (seq[i:(i + size)] for i in range(0, len(seq), size))
def encode(string, salt):
bytes = string.encode("UTF-8")
return [ord(bytes[i]) ^ salt[i % len(salt)] for i in range(0, len(bytes))]
bytes_ = string.encode("UTF-8")
return [bytes_[i] ^ salt[i % len(salt)] for i in range(0, len(bytes_))]
def snake_to_camel(snake_str):
components = snake_str.split('_')
return components[0].lower() + ''.join(x.title() for x in components[1:])
salt = [ord(byte) for byte in os.urandom(64)]
salt = [byte for byte in os.urandom(64)]
}%
import Secrets