On 07/02/15 11:53, Pádraig Brady wrote: > On 07/02/15 02:13, Assaf Gordon wrote: >> Hello, >> >> Attached is a proof-of-concept implementation supporting '--random=seed=N' >> option for sort/shuf/shred, >> to enable reproducible (pseudo) random runs. >> It was discussed a while ago, here: >> http://lists.gnu.org/archive/html/coreutils/2013-11/msg00068.html >> >> comments are welcomed, > > Reproducibility is a useful though not often required goal. > Playing devil's advocate, you could get it with: > > get_random() { seed="$1"; openssl enc -aes-256-ctr -pass pass:"$seed" > -nosalt </dev/zero 2>/dev/null; } > > shuf -i1-100 --random-source=<(get_random 42) > > While a separate dependency, it's widely available and we could document it. > > The advantage is that it's an existing mechanism > and uses more silicon to generate the random numbers.
No counter arguments, which is surprising. Anyway personally I prefer the --random-seed option as it's neater, has less deps, and is about 10% faster even with hardware assist. As for the --random-seed interface. Should we be supplying a string rather than an int? At least we need to cater for endianness issues with an int, but a string might be easier to use. thanks, Pádraig.