faro

0.2.2 • Public • Published

README

Faro

Perform faro out-shuffle for a string or an array. More information about faro: https://en.wikipedia.org/wiki/Faro_shuffle

Installation

npm i -S faro

Usage:

const faro = require('faro');
 
const { shuffle, unshuffle } = faro;
 
console.log(shuffle('foobar'));     // Shows fboaor
console.log(unshuffle('fboaor'));   // Shows foobar

Unshuffle undoes what shuffle does. The other way around would work too.

You can do the same, but for arrays:

const faro = require('faro');
 
const { shuffleArray, unshuffleArray } = faro;
 
console.log(shuffleArray(['f','o','o','b','a','r']));
console.log(unshuffleArray(['f','b','o','a','o','r']));

The following functions are available:

shuffle
shuffleArray
unshuffle
unshuffleArray
weave
weaveArray
unweave
unweaveArray

weave and shuffle are aliases, as are unweave and unshuffle.

Readme

Keywords

none

Package Sidebar

Install

npm i faro

Weekly Downloads

6

Version

0.2.2

License

MIT

Unpacked Size

7.18 kB

Total Files

4

Last publish

Collaborators

  • sandyman