tknverif v1.1.4
TknVerif
Please do not use this module in a malicious context.
How to install:
npm i tknverif
Features
Generate discord tokens
Check discord tokens
Check
How to use:
check(tokens, [simultanous, [onerror, [onsuccess]]])
Returns Array<Map<string token,boolean valid>>
tokens
Tokens to check
This is an array
simultanous
Number of invocations,defaulting to1
.
More is faster!
Set to default if it is bigger than tokens.length
onerror
Function to execute on error,defaulting to an empty function.
Called with options: token,index,invocationNumber,error
onsuccess
Function to execute on success,defaulting ot an empty function.
Called with options: token,index,invocationNumber,client
Examples
let tknVerif=require('tknverif')
let fs=require('fs')
let tokens=fs.readFileSync('tokens.csv','utf8').split(',')
tknVerif.check(tokens,3,(token)=>{console.log("token \""+token+"\" is invalid")},(token)=>{console.log("token \""+token+"\" is valid")})
Gen
How to use
gen(quantity)
Returns Array(string)
quantity
Quantity of tokens to generate
Examples
let tknVerif=require('tknverif')
tknVerif.gen(20)
.then(tokens=>{console.log(tokens)})
GenCheck
How to use
genCheck(quantity, [simultanous, [onerror, [onsuccess]]])
Returns Array<Map<string token,boolean valid>>
quantity
Quantity of tokens to generate
simultanous
Number of invocations,defaulting to1
.
More is faster!
Set to default if it is bigger than quantity
onerror
Function to execute on error,defaulting to an empty function.
Called with options: token,index,invocationNumber,error
onsuccess
Function to execute on success,defaulting ot an empty function.
Called with options: token,index,invocationNumber,client
Examples
let tknVerif=require('tknverif')
tknVerif.genCheck(20,3,(token)=>{console.log("token \""+token+"\" is invalid")},(token)=>{console.log("token \""+token+"\" is valid")})