Skip to content

Instantly share code, notes, and snippets.

@knwng
Created March 11, 2019 15:14
Show Gist options
  • Save knwng/beabc0f30ba7032029b18227e1c0cb48 to your computer and use it in GitHub Desktop.
Save knwng/beabc0f30ba7032029b18227e1c0cb48 to your computer and use it in GitHub Desktop.
Linux下生成随机字符串方法
# use runtime data
head -c 32 /dev/urandom | base64
head /dev/urandom | md5sum | head -c 32
# use date
date +%s%N | md5sum | head -c 32
# use openssl function
openssl rand -hex 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment