From a6b0615d945313dd1c058eb97cc02c460853411e Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Tue, 5 Dec 2017 21:13:10 +0100 Subject: bishuf: proper fixed source of randomness --- bishuf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bishuf') diff --git a/bishuf b/bishuf index e3560f6..62689aa 100755 --- a/bishuf +++ b/bishuf @@ -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 -- cgit v1.2.3