1.0.2 • Published 3 years ago

sd-generator v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Generate Random String, Number and other pattern

Install

$ npm install --save sd-generator

Usage

const generator = require("sd-generator")

console.log(generator.randomString(10,true)) // !HO=S.L^F&
console.log(generator.randomNumber(4)) // 6606
console.log(generator.randomCustom(6,'QWERTYUIOP')) // IWTEPY
console.log(generator.transactionCode()) // TRX-2021-03-11-5:44:41-4VIFC

SD-Generator Type Function

Below are special / custom functions to generate your string

functiondefaultdescriptionoutput
randomString(length,withSymbol)(4, false)generate your random stringstring
randomNumber(length)(4)generate your random numberstring
randomCustom(length,characters)(4, '')generate your custom stringstring
transactionCode(prefix,separator,utc,length)('TRX', '-', 0 , 5)generate transaction code easilystring

License

MIT © SDANALYZER