Generate random strings and numbers from from strings or group of numbers. Good for generating unique ids and strings.
npm install uniquechars
With ES6 module syntax
To get unique random strings without parameters
import { UNIQUE_STRING } from 'uniquechars'
console.log(UNIQUE_STRING()) // ⇨ 'QB|941@D#XK&5YD7' for example
To get unique random strings with parameters
import { UNIQUE_STRING } from 'uniquechars'
console.log(UNIQUE_STRING(string, length)) // ⇨ 'QB|941@D#XK&5YD7' for example
With CommonJS syntax
To get unique random strings without parameters
let { UNIQUE_STRING } = require('uniquechars')
console.log(UNIQUE_STRING()) // ⇨ 'QB|941@D#XK&5YD7' for example
To get unique random strings with parameters
let { UNIQUE_STRING } = require('uniquechars')
console.log(UNIQUE_STRING(string, length)) // ⇨ 'QB|941@D#XK&5YD7' for example
String must be a string data type and length must be a number data type.
With ES6 module syntax
To get unique random strings without parameters
import { UNIQUE_NUMBER } from 'uniquechars'
console.log(UNIQUE_STRING()) // ⇨ '1098276235427165' for example
To get unique random strings with parameters
import { UNIQUE_NUMBER } from 'uniquechars'
console.log(UNIQUE_STRING(string, length)) // ⇨ '1098276235427165' for example
With CommonJS syntax
To get unique random strings without parameters
let { UNIQUE_NUMBER } = require('uniquechars')
console.log(UNIQUE_STRING()) // ⇨ '1098276235427165' for example
To get unique random strings with parameters
let { UNIQUE_NUMBER } = require('uniquechars')
console.log(UNIQUE_STRING(number, length)) // ⇨ '1098276235427165' for example
Number must be a number data type and length must be a number data type.
With ES6 module syntax
To get unique random password without parameters
import { UNIQUE_PASS } from 'uniquechars'
console.log(UNIQUE_PASS()) // ⇨ 'QB|941@D#XK&5YD7' for example
To get unique random password with parameters
import { UNIQUE_PASS } from 'uniquechars'
console.log(UNIQUE_PASS(string, length)) // ⇨ 'QB|941@D#XK&5YD7' for example
With CommonJS syntax
To get unique random password without parameters
let { UNIQUE_PASS } = require('uniquechars')
console.log(UNIQUE_PASS()) // ⇨ 'QB|941@D#XK&5YD7' for example
To get unique random password with parameters
let { UNIQUE_PASS } = require('uniquechars')
console.log(UNIQUE_PASS(string, length)) // ⇨ 'QB|941@D#XK&5YD7' for example
String must be a string data type and length must be a number data type.
console.log(UNIQUE_STRING(string, length)) // ⇨ 'QB|941@D#XK&5YD7' for example
string = "#@%&*!(){}[]=_+|/\/ABCDEFGHIJKLMOPQRSTUVWXYZ1234567890"
length = 16
console.log(UNIQUE_NUMBER(number, length)) // ⇨ '1098276235427165' for example
number = "1234567890"
length = 16
console.log(UNIQUE_PASS(string, length)) // ⇨ 'QB|941@D#XK&5YD7' for example
string = "#@%&*!(){}[]=_+|/\/ABCDEFGHIJKLMOPQRSTUVWXYZ1234567890"
length = 16
MIT LICENSE