I read the man page on /dev/random; I wrote this package.
Can this function to seed quad-rl become part of gnu-apl?
I'm still struggling with how entropy, the tendency of the universe
toward disorder, be inventoried?
w
#! /usr/local/bin/apl --script
⍝ ********************************************************************
⍝ rl.apl Using the linux kernel to seed ⎕RL
⍝ Copyright (C) Bill Daly 2019
⍝ This program is free software: you can redistribute it and/or modify
⍝ it under the terms of the GNU General Public License as published by
⍝ the Free Software Foundation, either version 3 of the License, or
⍝ (at your option) any later version.
⍝ This program is distributed in the hope that it will be useful,
⍝ but WITHOUT ANY WARRANTY; without even the implied warranty of
⍝ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
⍝ GNU General Public License for more details.
⍝ You should have received a copy of the GNU General Public License
⍝ along with this program. If not, see <http://www.gnu.org/licenses/>.
⍝ ********************************************************************
∇seed←rl∆seed;sink
⍝ Function reads a seed from /dev/urandom (try man /dev/random)
fh←⎕FIO[3] '/dev/urandom'
st:
seed← (4⍴256)⊥4 ⎕FIO[6] fh
→(st,ed)[⎕io+ 4294967294>seed]
ed:
sink← ⎕FIO[4] fh
∇