GenerateCode.js
it used to produce 7 bit string, can be produced by quantity, not duplicated, can be verified.
easy to use
1、'cipher' you need to save, 'start' it need increase last sum value if you want to produced code in next time;
const generateCode = require('generateCode');
const cipher = generateCode.noRepeatStr(36); //example: DJosIOVYlEmahcr6Mf4dSCBqzNX1bPwteyGL
const start = 123;
const sum = 200;
const codeArray = generateCode.generate(cipher, start, sum);
console.info(codeArray);
2、how to verified?
const generateCode = require('generateCode');
const isValidate = generateCode.validate('DFda3j3', 'DJosIOVYlEmahcr6Mf4dSCBqzNX1bPwteyGL');
console.info('isValidate:' + isValidate);
end
The code is very simple, you are so smart and you must be understand.