numbers-station
v0.4.2
Published
An HTTP server for generating a pseudorandom series of numbers.
Downloads
19
Readme
numbers-station
An HTTP server for generating a pseudorandom series of numbers. Useful for running a numbers station.
The server broadcasts a single stream of numbers. Clients requesting the current number at the same time will receive the same number. For example, you could use a numbers station like this in identity challenges by requiring an untrusted individual to demonstrate they are following the same feed. By using a low modulo value, you can generate streams of numbers with a convenient upper bound.
Unlike shortwave numbers stations, an HTTP server can be hidden from the pubnet and secured behind a firewall, and does not have to compete for a slice of the radio spectrum.
Installation & Usage
Install with npm:
npm i -g numbers-station
Or get the source code with git:
git clone https://github.com/garbados/numbers-station
cd numbers-station
npm i
npm link
Now run numbers-station
to start the server, or numbers-station --help
for usage information.
Once you've started the server, you can watch its output with a command like this to get new numbers periodically:
while sleep 5; do curl $SERVER; done
Where $SERVER
is the URL of the numbers station.
About these random numbers
numbers-station uses the built-in nodejs crypto library which draws from the host machine's entropy pool. This process generates bytes which are converted to numbers using bitwise methods derived from joepie91/node-random-numner-csprng in an effort to minimize any bias introduced during the transform.
If you notice any problems with this process, or know of ways to improve it, please file an issue!
Testing
Once you've downloaded the source, you can run the test suite with npm test
:
git clone https://github.com/garbados/numbers-station
cd numbers-station
npm i
npm test