static-shuffle

v1.0.0
Creates a deterministic shuffle of an input array based on a provided seed

Static shuffle

Create a deterministic shuffle of an array given a seed

Install

npm install static-shuffle

Usage

const shuffle = require('static-shuffle');
shuffle(['Apple', 'Banana', 'Blueberry', 'Orange', 'Strawberry', 'Watermelon'], 'anything you want!');

// result
// ['Blueberry', 'Watermelon', 'Orange', 'Strawberry', 'Apple', 'Banana']
npm i static-shuffle

Metadata

  • MIT
  • Whatever
  • Craig Campbell
  • released 8/28/2020

Downloads

Maintainers