-3

I got an email for verification . http://xyz.pythonanywhere.com/record/upload/f690928d034d27ebb943b3f9bc9e3ae9/12. How is the string f6909..... Generated and is there a way to find out the pattern ? Is there any function which is generating the random string for different email addresses ?

Anonymous
  • 1
  • 1

1 Answers1

0

For best practices for generating URL-safe text strings you should look into pythons secrets module. Specifically the secrets.token_urlsafe([nbytes=None]) function which generates the string randomly. If properly generated the string should be almost impossible to predict or guess.

Here is the usage example for generating a hard-to-guess temporary URL containing a security token suitable for password recovery applications:

import secrets
url = 'https://example.com/reset=' + secrets.token_urlsafe()
Toni Sredanović
  • 2,280
  • 1
  • 11
  • 13