Socket
Book a DemoInstallSign in
Socket

cointoss

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cointoss

Securely toss a coin

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

cointoss

Toss a cryptographically secure coin.

What?

Exports a function that, when called, returns either true or false randomly and cryptographically securely.

Why?

Because if there's one thing npm needs more of, it's 3-line packages.

How?

const cointoss = require('cointoss');
if (cointoss()) {
	console.log("Heads");
} else {
	console.log("Tails");
}

FAQs

Package last updated on 27 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts