randomizr

1.0.0 • Public • Published

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

Arguments Description
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: '$-<>?:;'
})

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i randomizr

      Weekly Downloads

      11

      Version

      1.0.0

      License

      MIT

      Unpacked Size

      7.93 kB

      Total Files

      5

      Last publish

      Collaborators

      • mitzerh