Toss a cryptographically secure coin.
Exports a function that, when called, returns either true
or false
randomly and cryptographically securely.
Because if there's one thing npm needs more of, it's 3-line packages.
const cointoss = require('cointoss');
if (cointoss()) {
console.log("Heads");
} else {
console.log("Tails");
}