
Sept. 20, 2015
2:14 a.m.
On Sun, Sep 20, 2015 at 9:40 AM, Tim Peters <tim.peters@gmail.com> wrote:
Token functions .token_bytes(nbytes) another name for os.urandom() .token_hex(nbytes) same, but return string of ASCII hex digits .token_url(nbytes) same, but return URL-safe base64-encoded ASCII .token_alpha(alphabet, nchars) string of `nchars` characters drawn uniformly from `alphabet`
token_bytes "obviously" should return a bytes, and token_alpha equally obviously should be returning a str. (Or maybe it should return the same type as alphabet, which could be either?) What about the other two? Also, if you ask for 4 bytes from token_hex, do you get 4 hex digits or 8 (four bytes of entropy)? ChrisA