/var/www/greso.tech/server/nsm/node_modules/qrcode/lib/core
NameSizeModeActions
alignment-pattern.js29960644editdlrm
alphanumeric-data.js18220644editdlrm
bit-buffer.js7190644editdlrm
bit-matrix.js15010644editdlrm
byte-data.js6850644editdlrm
error-correction-code.js34150755editdlrm
error-correction-level.js8930644editdlrm
finder-pattern.js5990644editdlrm
format-info.js11260644editdlrm
galois-field.js18990644editdlrm
kanji-data.js15840644editdlrm
mask-pattern.js61010644editdlrm
mode.js39830644editdlrm
numeric-data.js12110644editdlrm
polynomial.js15890644editdlrm
qrcode.js151280644editdlrm
reed-solomon-encoder.js16250644editdlrm
regex.js10840644editdlrm
segments.js93310644editdlrm
utils.js16210644editdlrm
version-check.js2680644editdlrm
version.js49280755editdlrm
Edit: /var/www/greso.tech/server/nsm/node_modules/qrcode/lib/core/numeric-data.js (1211B)
const Mode = require('./mode') function NumericData (data) { this.mode = Mode.NUMERIC this.data = data.toString() } NumericData.getBitsLength = function getBitsLength (length) { return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0) } NumericData.prototype.getLength = function getLength () { return this.data.length } NumericData.prototype.getBitsLength = function getBitsLength () { return NumericData.getBitsLength(this.data.length) } NumericData.prototype.write = function write (bitBuffer) { let i, group, value // The input data string is divided into groups of three digits, // and each group is converted to its 10-bit binary equivalent. for (i = 0; i + 3 <= this.data.length; i += 3) { group = this.data.substr(i, 3) value = parseInt(group, 10) bitBuffer.put(value, 10) } // If the number of input digits is not an exact multiple of three, // the final one or two digits are converted to 4 or 7 bits respectively. const remainingNum = this.data.length - i if (remainingNum > 0) { group = this.data.substr(i) value = parseInt(group, 10) bitBuffer.put(value, remainingNum * 3 + 1) } } module.exports = NumericData