node-pix-payload
Version:
This library that aims to build the payload of pix payment, with this payload the developer can generate the qr code payable or pay informed the same in the bank's app.
17 lines (16 loc) • 587 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// @ts-nocheck
const node_crc_1 = __importDefault(require("node-crc"));
class Crc {
/**
* this method is responsible for calcule crc16 and generate validation hash of the pix code.
*/
calculeCrc16(payload) {
return node_crc_1.default.crcccitt(Buffer.from(payload, 'utf8'), {}).toString('hex').toUpperCase();
}
}
exports.default = new Crc();
;