Answers for "create random id python"

8

python generate uid

# Python3 code to generate the 
# random id using uuid1() 
  
import uuid 
  
# Printing random id using uuid1() 
print ("The random id using uuid1() is : ",end="") 
print (uuid.uuid1())
Posted by: Guest on April-06-2020
5

python generate id

import secrets

secrets.token_urlsafe(16)
# 'DfpKRcWH50lOVjllN4t2ww'
secrets.token_hex(16)
# 'c3696cfb5ca4605a48764a1b14c8096a'
secrets.token_bytes(16)
# b'\xa50\xd1\xdcE\x9d<\x12\x81<\xf4\x8b:?\xce\xfe'
Posted by: Guest on October-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language