refactor jwt secret
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
num_bytes=16
|
||||
|
||||
# Use dd to read cryptographically secure bytes from /dev/urandom
|
||||
# and convert them to integers using od
|
||||
secure_bytes=$(dd if=/dev/urandom bs=1 count=$num_bytes 2>/dev/null | od -An -tu1)
|
||||
# and convert them to hexadecimal using od
|
||||
secure_bytes=$(dd if=/dev/urandom bs=1 count=$num_bytes 2>/dev/null | od -An -tx1)
|
||||
|
||||
# Remove leading/trailing spaces and replace spaces with commas
|
||||
secure_bytes=$(echo $secure_bytes | sed 's/ /,/g')
|
||||
# Remove leading/trailing spaces and concatenate the hex bytes into a single string
|
||||
secure_bytes=$(echo $secure_bytes | tr -d ' \n')
|
||||
|
||||
# Output the result as a comma-separated list of integers
|
||||
echo "Cryptographically secure bytes (as integers): $secure_bytes"
|
||||
# Output the result as a hexadecimal string
|
||||
echo "Cryptographically secure bytes (as hex): $secure_bytes"
|
||||
|
||||
Reference in New Issue
Block a user