Hi ππ
Today, I will share with you how to Generate Secure Tokens in Python and module called secrets.
What is secrets π€
Generate token
import secrets
print(secrets.token_hex(20))
result
ac8a374b58cd08c75bc74216e4c2581fed247f35
Generate token for url
import secrets
print(secrets.token_urlsafe())
result
Gcwc7xUovto_hH7A_EqR6ldINqCPlQ5a_BiPOxdVhJM