Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

A deterministic method to shuffle array items for @nodejs

License

Notifications You must be signed in to change notification settings

faustbrian/node-deterministic-array-shuffle

Repository files navigation

You can help the author become a full-time open-source maintainer by sponsoring him on GitHub.


@faustbrian/node-deterministic-array-shuffle

npm version

Installation

pnpm install @faustbrian/node-deterministic-array-shuffle

Usage

import { shuffle } from "@faustbrian/node-deterministic-array-shuffle";

shuffle("1", [1, 2, 3, 4, 5]) // [1, 5, 4, 3, 2]
shuffle("2", [1, 2, 3, 4, 5]) // [2, 3, 5, 4, 1]
shuffle("3", [1, 2, 3, 4, 5]) // [4, 3, 5, 1, 2]

License

This is an open-sourced software licensed under the AGPL-3.0-or-later.