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

后端 未结 5 636
暗喜
暗喜 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:03

    Try:

    xxd -u -l 16 -p /dev/urandom
    

    Example output:

    C298212CD8B55F2E193FFA16165E95E3
    

    And to convert it back to binary:

    echo -n C298212CD8B55F2E193FFA16165E95E3 | xxd -r -p
    

提交回复
热议问题