Let’s benchmark the script by having it output 10 million random strings to a text file named “hashes.txt” also prepend it with the time command, so we can determine how fast it is, like so: Print('Error: The number must be a positive decimal integer')Īnd we are ready to try it! The script needs one argument, which much be a positive decimal integer, or the script will give you an error code and quit. Print(binascii.hexlify(os.urandom(32)).decode()) Print('Error: Please state the number of outputs') Without further ado, fire up your favorite text editor, paste the following Python code and save the file as “randomhex”: #!/usr/bin/env python3 Along with the usual disclaimer: do not use this one IRL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |