quantumrandom icon indicating copy to clipboard operation
quantumrandom copied to clipboard

v1.9.0 Random subclass, fetch timeout

Open calebj opened this issue 7 years ago • 0 comments

Adds a subclass of random.Random that pulls from the ANU QRN server. It defaults to caching 1kb of raw binary data, and automatically fetches more on demand, or in the background when less than 64 bytes of random data remain. These parameters can be adjusted in the QuantumRandom constructor: caching can be disabled by specifying cached_bytes = None, and auto-fetching disabled with autofetch_at = None.

get_data() also has a new parameter timeout, which is passed directly to urlopen(), and the other data-retrieving functions will pass their kwargs through so that timeout can be specified in any of them.

Missing until the base idea is greenlit:

  • [ ] docs
  • [ ] tests

calebj avatar Nov 10 '18 01:11 calebj