Generate random number directory
- Generate a random number: the default is (0-32767)
- Generate a random number in the specified interval: randomly generate a number between 1-50
- Randomly generate timestamp seconds and nanoseconds encryption operations
- Generate a random character to specify 10 in the use of md5sum check
- Generate random UUID
- Encryption Algorithm
- related articles
Generate a random number: the default is (0-32767)
echo $RANDOM
Generate a random number in the specified interval: randomly generate a number between 1-50
echo $((RANDOM%50+1))
Randomly generate timestamp seconds and nanoseconds encryption operations
date +%s%N | md5sum
Generate a random character to specify 10 in the use of md5sum check
head -c 10 /dev/random |md5sum
What is /dev/random?
/dev/random is a random number generator device file used to generate high-quality random numbers. It generates random numbers by collecting environmental noise on the system such as hardware noise, disk activity, etc. Since it can only generate random numbers when there is enough ambient noise on the system, the random numbers generated by /dev/random are of high quality.
However, the main disadvantage of /dev/random is that if there is not enough ambient noise on the system, it will cause random number generation to slow down, and sometimes stop altogether. This may cause some applications to not work properly because they require large numbers of random numbers.
Generate random UUID
UUID, universal unique identifier.
Let all elements of the distributed system have unique identification information.
uuidgen
cat /proc/sys/kernel/random/uuid
Encryption Algorithm
md5 message digest algorithm –> verify the integrity of the file
md5sum [file name]
echo "123" | md5sum
CRC Cyclic Redundancy Check Code –>sksum
echo “123” | sksum