Closed Dreamsorcerer closed 4 years ago
Do you have real use case? How it should look like?
ToBytes(encoding='utf-8')
?
Looks reasonable, yes. Use case is to pass an argument such as a password into a password hashing function, which requires bytes.
login = t.Dict({"password": t.ToBytes(encoding="utf-8"), "username": t.String()})
hashlib.scrypt(login["password"], ...)
There is a FromBytes object to convert to string. It would be nice to have the inverse to convert to bytes.