import secrets secrets.token_urlsafe(16) # 'DfpKRcWH50lOVjllN4t2ww' secrets.token_hex(16) # 'c3696cfb5ca4605a48764a1b14c8096a' secrets.token_bytes(16) # b'xa50xd1xdcEx9d<x12x81<xf4x8b:?xcexfe'