Socket
Socket
Sign inDemoInstall

de-bruijn-generator

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    de-bruijn-generator

A javascript implementation of the de Bruijn sequence algorithm


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Install size
7.00 kB
Created
Weekly downloads
 

Readme

Source

De Bruijn sequence javascript generator

A javascript implementation of the de Bruijn sequence algorithm

Exemple :

const { deBruijn } = require('de-bruijn-js-generator');

let generator = deBruijn(10, 8); // create a generator for a 8 digits code in base 10
// if the third argument is true you will get the entire code every time
let value = generator.next().value;

while (value != undefined) {
  value = generator.next().value; // here value contain only the new digit
  console.log(value);
}

Methods

The only method provided is call deBruijn it take three arguments :

  • k is the alphabet (as an array) or the max digit (excluded)
  • n is the length of the code
  • s is optional (false by default), if true the entire code will be returned at every iterations

Install :

With npm

npm install de-bruijn-generator

On browser

<script src="./src/index.js"></script>
let generator = deBruijnGenerator.deBruijn(10, 8);
generator.next().value;

Keywords

FAQs

Last updated on 01 Apr 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc