[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] An inventory of entropy

From: Dr . Jürgen Sauermann
Subject: Re: [Bug-apl] An inventory of entropy
Date: Sat, 22 Jun 2019 15:39:15 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1


fixed in SVN 1172.

Monadic ⎕FIO[60] B now returns an integer random value from /dev/urandom.
Dyadic 0
⎕FIO[60] B is the same as monadic ⎕FIO[60] B.
Dyadic 1  ⎕FIO[60] B returns a byte vector of length B instead of an integer
scalar. (for those who prefer to pack the random bytes themselves).

If B < 8 then the monadic result of
⎕FIO[60] B is unsigned (positive),
while for B = 8 it is signed.

Best Regards,

On 6/22/19 1:59 PM, Dr. Jürgen Sauermann wrote:
Hi Bill, Kacper,

I have stored the rl.apl file in the GNU APL Bits and pieces directory:


Storing it there brings it faster to the people because the frequency of "official"
GNU APL releases is rather low and I wonder if they are a relict from the past,
compared to "rolling updates" that are now used by more and more projects.

Looking at getrandom() and friends it seems like they have considerable
portability problems (e.g. the header files are missing on Mint-17 but
available on Mint-19). From that perspective using /dev/urandom seems
to be a better approach in the moment. I will look into adding ⎕FIO[60].

Best Regards,
Jürgen Sauermann

On 6/21/19 10:27 PM, Kacper Gutowski wrote:
I used something similar installed as an user command, but it's a trivial
one-liner and only good reason to include it in distribution would be to
do it right while avoiding possible mistakes and pitfalls—which the
proposed code doesn't do. (Where does 4294967294 come from?  Twice the
MINSTD modulus?  It seems to be written for different interpreter because
it's a tiny fraction of the 64-bit state used by GNU APL's ⎕RL.)

However, doing it through ⎕FIO sounds like a really good idea, because
it could, for example, instead of reading from /dev/urandom, expose the
getentropy/getrandom syscall on systems that support it (which includes
linux >3.17) with only reading from a device as a fallback on systems
that don't.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]