$ npm install sec-id
const Generator=require('sec-id')
var NormalId=Generator.GenerateId({length:15})
//Put the length of the Id into the parameter field.
var NumberId=Generator.GenerateNumberId({length:15})
console.log(NormalId)
console.log(NumberId)
//eugjdnsl471Gher
//295739587936457
[handler].[function]({length:Number,pattern:Sharp-Pattern})
#!/usr/bin/env node
const g=require("sec-id")
g.GenerateCustomizePatternId({length:999,pattern:"usr82194*#"})
//usr82194*u8ow3ehf45378tc54jo934c8jhzjhJKJYHKKOJGjw7hc87whrty7v4ryr9gterhtr97je4tc753w78gGFJGGJEGGFDSZJtzr6rewr4376r643r8wygfjsdgfjskd...
const Generator=require('sec-id')
var NormalId=Generator.GenerateSecId()//This Id is suitable for Secure Purposes
var MixId=Generator.GenerateMixedAlphaId()//Mixed alphabet id
var Upper=Generator.GenerateUpperId()//Uppercase only id
var Lower=Generator.GenerateLowerId()//Lowercase id
var NumberSlash=Generator.GenerateNumHyphId()//Id with number and hyphen -
var Customizr=Generator.GenerateCustomizeId({length:24,datastring:"YourDataString"})//Get ID with custumized characters
We support customize patterns
var Pattern=g.GenerateCustomizePatternId({length:15,pattern:"user123#"})
//Use # to be the part you want to have random id.
console.log(Pattern)
//user123E5Gc6K3d
You can use this function in many ways such as user management system(with the help of other packages)
//Example
var db=[{userid:"User12345678901234567890",password:"1234567",
device:"Windows 11,Chrome,version 100"}]
var newUserID=g.GenerateCustomizePatternId({length:24,pattern:"User#"})
db.push({userid:newUserID,password:request.body.password,device:request.body.device})
response.send("User Created")
ModuleName.Function({length:number,datastring:string})
request.cookies.LoginId=Generator.GenerateId({length:Math.floor(Math.random()*88)+12})
//You can have an Id to identify users.
- S-Studio
var Pattern=g.GenerateCustomizePatternId({length:15,pattern:"user123#"})
2022/08/19 v2.0,v2.1 Add a function Changed the name
2022/08/19 v1.0 Create the package
Please find me on Github This project ▶ Github Repo
ISC Licensed.