1.0.0 • Published 4 years ago

randomizr v1.0.0

Weekly downloads
19
License
MIT
Repository
github
Last release
4 years ago

Randomizr

Random string generator

Install

npm install randomizr
const randomizr = require('randomizr');

let hash = randomizr();

Methods

randomizr()

Generates a random sha256 hash

randomizr()

randomizr.range([Number: min], [Number: max])

Generate a random number between the min - max range

randomizr.range(0, 99)

randomizr.generate([Number: length], [Object: properties])

Generates a random string based on your preferences

Arguments

ArgumentsDescription
length(Optional) The string length you want to generate [ default: 64 ]
properties(Optional) Custom properties

properties

  • type - set character options: [ default: alphanumeric ]
    • alpha - alphabet only
    • numeric - numbers only
  • add - add custom characters
  • custom - use custom characters only
  • camelCase - randomize lower or upper case for alphabets

Examples

256 alphanumeric characters

randomizr.generate(256)

32 characters, alphanumeric + camel-case

randomizr.generate(32, {
  camelCase: true
})

128 characters, numbers only

randomizr.generate(128, {
  type: 'numeric'
})

16 characters, 1 or 0

randomizr.generate(16, {
  custom: '10'
})

16 characters, add custom characters

randomizr.generate(16, {
  add: '#@!$%'
})

16 characters, only these custom characters

randomizr.generate(16, {
  custom: '$-<>?:;'
})