Simple Module for generating Random Strings by native.
Normally, generate random string is easy, but it's not good performance if need to generate a huge random string at once
Install the module with: npm install randomstring-native
number - the length of your resulting string (DEFAULT: 10)
number - number string to be generated (DEFAULT: 1)
string - character set (DEFAULT: '0123456789abcdefghijklmnopqrstuvwxyz')
string - random string generation method. It can be 'mt19937', 'crypto' or 'random' (DEFAULT: 'crypto')
array - the string generated will not appear in this list
const generator = require('randomstring-native');
// Generate 1000000 random strings
let uids = generator.generate({
'charset': '0123456789abcdefghijklmnopqrstuvxyz',
'length': 10,
'count': 1000000,
'method': 'random',
'excludes': ['003fy23h5m', '003g18hjv7']
})
Copyright (c) 2021 nkb84 Licensed under the MIT license.