Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matubu/de-bruijn-generator
📦 A javascript implementation of the de Bruijn sequence algorithm
https://github.com/matubu/de-bruijn-generator
algorithm browser combinations debruijn generator javascript js nodejs sequence
Last synced: 23 days ago
JSON representation
📦 A javascript implementation of the de Bruijn sequence algorithm
- Host: GitHub
- URL: https://github.com/matubu/de-bruijn-generator
- Owner: matubu
- License: mit
- Created: 2021-03-30T18:43:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-10T18:47:31.000Z (over 2 years ago)
- Last Synced: 2024-04-23T23:46:48.023Z (7 months ago)
- Topics: algorithm, browser, combinations, debruijn, generator, javascript, js, nodejs, sequence
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# De Bruijn sequence javascript generator
📦 a javascript implementation of the [de Bruijn sequence](https://en.wikipedia.org/wiki/De_Bruijn_sequence) algorithm## Exemple :
``` js
const { deBruijn } = require('de-bruijn-generator');let generator = deBruijn(10, 8), value; // create a generator for a 8 digits code in base 10
// if the third argument is true you will get the entire code every timewhile (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](https://www.npmjs.com/package/de-bruijn-generator)
```
npm install de-bruijn-generator
```On browser
``` html```
``` js
let generator = deBruijnGenerator.deBruijn(10, 8);
generator.next().value;
```