TipsShell: générer chaîne hexa avec /dev/urandom
This commit is contained in:
parent
55c2dde0f3
commit
4da4a1f3c6
|
@ -766,12 +766,18 @@ $ tr -cd [:alnum:] < /dev/urandom | head -c22; echo
|
||||||
|
|
||||||
### En hexadecimal
|
### En hexadecimal
|
||||||
|
|
||||||
Pour générer 6 octets en hexadecimal :
|
Pour générer 12 charactères :
|
||||||
|
|
||||||
~~~{.bash}
|
~~~{.bash}
|
||||||
$ openssl rand -hex 6
|
$ openssl rand -hex 6
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
Sans la commande `openssl` :
|
||||||
|
|
||||||
|
~~~{.bash}
|
||||||
|
tr -cd a-f0-9 < /dev/urandom | head -c12; echo
|
||||||
|
~~~
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
|
|
||||||
Les variables d'environnement actuelles :
|
Les variables d'environnement actuelles :
|
||||||
|
|
Loading…
Reference in a new issue