TipsShell: générer chaîne hexa avec /dev/urandom

This commit is contained in:
Alexis Ben Miloud--Josselin 2023-09-22 09:32:21 +02:00
parent 55c2dde0f3
commit 4da4a1f3c6

View file

@ -766,12 +766,18 @@ $ tr -cd [:alnum:] < /dev/urandom | head -c22; echo
### En hexadecimal
Pour générer 6 octets en hexadecimal :
Pour générer 12 charactères :
~~~{.bash}
$ openssl rand -hex 6
~~~
Sans la commande `openssl` :
~~~{.bash}
tr -cd a-f0-9 < /dev/urandom | head -c12; echo
~~~
## Variables
Les variables d'environnement actuelles :