Home > bash > Generating a random string

Generating a random string

Problem: You want to generate some random strings.

Solution:

$ dd if=/dev/urandom count=1 bs=32|base64
1+0 records in
1+0 records out
32 bytes (32 B) copied, 5.7006e-05 s, 561 kB/s
Da86DdCu/fyqdZasjzMA3sn0Psq+v5nogGKXtZTLgWE=

$ dd if=/dev/urandom count=1 bs=32|base64
1+0 records in
1+0 records out
32 bytes (32 B) copied, 5.444e-05 s, 588 kB/s
ovuUVjbLD4QG3ZkyzFjUJ7ntbdmXpI81VoZsg/42Png=

$ dd if=/dev/urandom count=1 bs=32|base64
1+0 records in
1+0 records out
jHNLGhNI9bgxfXNMgA423dD1MDBNf4JUgO0LFnMOjMQ=
32 bytes (32 B) copied, 0.000972518 s, 32.9 kB/s
Advertisements
Categories: bash Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: