permutater

1.0.2 • Public • Published

Generates all possible values based on a defined length.. with or without a limit

const permutater = require('permutater');
permutater({
    characters : 'abcdefghijklmnopqrstuvwxyz0123456789'.split(''),
    length : 3
})
// ['aaa', 'aab', 'aac' ... '997', '998', '999'].length = 46656
permutater({
    charactersAt : {
        0 : ['0', '1', '2']
    },
    characters : 'abcdefghijklmnopqrstuvwxyz'.split(''),
    length : 2
})
// ['0a', '0b', '0c' ... '2x', '2y', '2z'].length = 78
permutater({
    charactersAt : {
        0 : ['a', 'b'],
        1 : ['-']
    },
    characters : 'abcdefghijklmnopqrstuvwxyz'.split(''),
    length : 3
})
// ['a-a', 'a-b', 'a-c' ... 'b-x', 'b-y', 'b-z'].length = 52
permutater({
    characters : 'abcdefghijklmnopqrstuvwxyz0123456789'.split(''),
    length : 5,
    limit : 30
})
// ['fn6p3', 'x83na', '3v20r' ... ].length = 30

Dependents (2)

Package Sidebar

Install

npm i permutater

Weekly Downloads

23

Version

1.0.2

License

MIT

Last publish

Collaborators

  • cosmn