How to get a random string of 32 hexadecimal digits through command line?

后端 未结 5 637
暗喜
暗喜 2021-01-31 14:00

I\'d like to put together a command that will print out a string of 32 hexadecimal digits. I\'ve got a Python script that works:

python -c \'import random ; prin         


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 15:04

    If you are looking for a single command and have openssl installed, see below. Generate random 16 bytes (32 hex symbols) and encode in hex (also -base64 is supported).

    openssl rand -hex 16
    

提交回复
热议问题