Random hex strings
How to generate random hex string in various languages
As a developer is sometimes happens that I need to generate some random bytes as a hexadecimal string. This could be the case if you need a short lived token of some kind.
This is not something you should use to generate a password for any environment.
So I have compiled a small sample in the languages I usually develop in.
C#
| |
Python
| |
Ruby
| |
PHP
| |
NodeJS
| |
This post is licensed under CC BY 4.0.