Non-licensed English language version, containing the same information:
Once per second, read /proc/sys/kernel/random/entropy_avail and if the resulting number is more than 1500 perform a read of 1000 bytes from /dev/random.
Not licensing something is, ironically, restrictive. If you want to release to public domain (or equivalent), you have to explicitly mention that. E.g. by licensing under CC0.
Otherwise, default copyright and "all rights reserved" applies.
https://creativecommons.org/share-your-work/public-domain/cc...
(But, IMO, nothing wrong with publicizing use of GPL 3! :) thanks either way to both)
If someone writes the same one-sentence pseudocode as GP in a book or blogpost, nobody could reasonably claim that an implementation would fall under the copyright of that book. And I think you'd be very hard pressed to argue it's copyrightable just because someone typed it out into real code.
#!/usr/bin/env ruby
source = File.open('/dev/random', 'rb')
loop do
source.read(1000) unless File.read('/proc/sys/kernel/random/entropy_avail').to_i < 1500
sleep 1
endThe missing mechanism we're trying to emulate used to essentially read N bytes (whatever user space happened to want at the time) every M seconds our experience has been that that can be way more than 1000 bytes, but reduce it if you like