v0.js
function encode(batch, id, ver) {
    //producerId min 2 digits
    let producerId = b36.int2Str36(batch.producerId).padStart(2, '0');
    //producerId min 3 digits
    let batchId = b36.int2Str36(batch.id).padStart(3, '0');
    //id min 2 digits
    id = b36.int2Str36(id).padStart(3, '0');

    let msg = composeCode(producerId, batchId, id);

    let sign = sign2Str36(dsa.doSign(batch.dsa, batch.privateKey, msg, hash.vsHash));

    let codeDescr =  generateCodeDescr(producerId, batchId, id, sign, ver);

    return codeDescr ? (codeDescr + msg + sign) : '';
}
function encode(batch, id, ver) {
    //producerId min 2 digits
    let producerId = b36.int2Str36(batch.producerId).padStart(2, '0');
    //producerId min 3 digits
    let batchId = b36.int2Str36(batch.id).padStart(3, '0');
    //id min 2 digits
    id = b36.int2Str36(id).padStart(3, '0');

    let msg = composeCode(producerId, batchId, id);

    let sign = sign2Str36(dsa.doSign(batch.dsa, batch.privateKey, msg, hash.vsHash));

    let codeDescr =  generateCodeDescr(producerId, batchId, id, sign, ver);

    return codeDescr ? (codeDescr + msg + sign) : '';
}
function encode ( batch , id , ver ) { //producerId min 2 digits let producerId = b36 . int2Str36 ( batch . producerId ) . padStart ( 2 , '0' ) ; //producerId min 3 digits let batchId = b36 . int2Str36 ( batch . id ) . padStart ( 3 , '0' ) ; //id min 2 digits id = b36 . int2Str36 ( id ) . padStart ( 3 , '0' ) ; let msg = composeCode ( producerId , batchId , id ) ; let sign = sign2Str36 ( dsa . doSign ( batch . dsa , batch . privateKey , msg , hash . vsHash ) ) ; let codeDescr = generateCodeDescr ( producerId , batchId , id , sign , ver ) ; return codeDescr ? ( codeDescr + msg + sign ) : '' ; }
creates alphanum representation of marking code
@param {{id: number, dsa: {q: number, p: number, g: number}, version: number, producerId: number, publicKey: number, privateKey: number}} batch
@param {*} id
@param {number} [ver]
creates alphanum representation of marking code