Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: zeugma
for "my" purposes i have used clocktime or pingtimes for random numbers
6 posted on 03/01/2021 11:08:17 AM PST by Chode (Ashli Babbitt - #SayHerNAME)
[ Post Reply | Private Reply | To 5 | View Replies ]


To: Chode
On a Linux box:
To display nanoseconds since 1/1/1970 00:00 UTC
$ date +%s%N
1614626686572918473

Pipe that through shasum...
$ date +%s%N | sha256sum
192f7fb540c80cc5aaadb35684619c4b2bbb451e872b8912bef0ca901eaae74d -

Deterministic, yet 'random'... Good enough for a seed anyway

Here's the same thing executed 5 times as fast as my computer can do it...

$ for x in {1..5}; do date +%s%N | sha256sum;done
15fb0d6dee447381c65560639d61d48124a5e973240664a9a25226a3a81ca788 -
3910b4460702eef4b34425a206ae1d16a0383e763643d4fddd0f4f6bffbda686 -
795958ab9645b5b3b4acac36f0de026396741e37e5b72e6e07743ec3b6446280 -
e1ad6e2025e32ef5a8b87de5fcd31da71d5b57ec9cdae4929582538da5f151e4 -
a8251c337b8503ea5475f0e30e22bc32d53908199be33242464d0c3fa354836f -

7 posted on 03/01/2021 11:33:52 AM PST by zeugma (Stop deluding yourself that America is still a free country.)
[ Post Reply | Private Reply | To 6 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson