diff options
author | Patrick Simianer <p@simianer.de> | 2017-12-05 21:13:10 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2017-12-05 21:13:10 +0100 |
commit | a6b0615d945313dd1c058eb97cc02c460853411e (patch) | |
tree | 26a28f9d08cb68a4f4798f74f4515992fcc06f3c /bishuf | |
parent | 48fc2e94f023deb0783befdf970a5ae81e585e48 (diff) |
bishuf: proper fixed source of randomness
Diffstat (limited to 'bishuf')
-rwxr-xr-x | bishuf | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -9,9 +9,10 @@ if [[ $? -ne 0 ]]; then fi fi -F=$(mktemp /tmp/bishuf.XXXXXX) -echo 42 > $F -$SHUF --random-source=$F $1 > $1.shuf -$SHUF --random-source=$F $2 > $2.shuf -rm $F + +get_random() { seed="$1"; openssl enc -aes-256-ctr -pass pass:"$seed" -nosalt < /dev/zero 2>/dev/null; } + +echo "shuffling ..." +$SHUF --random-source=<(get_random 42) $1 > $1.shuf +$SHUF --random-source=<(get_random 42) $2 > $2.shuf |