Socket
Book a DemoInstallSign in
Socket

random-permutation

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-permutation

Generates a random permutation

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

random-permutation

Generates a random permutation

Example

var randPerm = require("random-permutation")

console.log(randPerm(10))
console.log(randPerm(5))

Example output:

[ 5, 3, 7, 9, 2, 1, 6, 0, 4, 8 ]
[ 2, 0, 1, 4, 3 ]

Install

npm install random-permutation

API

require("random-permutation")(n)

Generates a random permutation on n elements

  • n is the number of elements in the permutation

Returns A random permutation

Credits

(c) 2014 Mikola Lysenko. MIT License

Keywords

random

FAQs

Package last updated on 22 Apr 2014

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