Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

knuth-shuffle-seeded

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knuth-shuffle-seeded

The Fisher-Yates (aka Knuth) shuffle for Node.js, with seeding support

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1M
decreased by-21.12%
Maintainers
1
Weekly downloads
 
Created

What is knuth-shuffle-seeded?

The knuth-shuffle-seeded npm package provides a seeded implementation of the Knuth (or Fisher-Yates) shuffle algorithm. This allows for reproducible shuffling of arrays, which can be useful in scenarios where deterministic results are needed, such as in testing or simulations.

What are knuth-shuffle-seeded's main functionalities?

Seeded Shuffle

This feature allows you to shuffle an array in a reproducible manner using a seed. The same seed will always produce the same shuffled array.

const shuffle = require('knuth-shuffle-seeded');
const seed = 'my-seed';
let array = [1, 2, 3, 4, 5];
shuffle(array, seed);
console.log(array);

Other packages similar to knuth-shuffle-seeded

Keywords

FAQs

Package last updated on 20 Jan 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc