Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: use of rand() in zsh



On 10/10/2022 10:34 PM, Bart Schaefer wrote:
On Mon, Oct 10, 2022 at 6:32 PM Clinton Bunch <cdbunch@xxxxxxxxxxx> wrote:
I wonder if it wouldn't be worthwhile to create a module that gave
access to better sources of random numbers on the systems that support them.
zmodload zsh/mathfunc
print $(( rand48() ))

Yeah, I know about  e/rand48 but that's only slightly better than rand().

I was suggesting something that accessed the kernel entropy pool like bash's SRANDOM variable.    I know not every Unix has such a thing, but it would be useful on those that do.





Messages sorted by: Reverse Date, Date, Thread, Author