MCPcopy Create free account
hub / github.com/breck7/scroll / makeNumeric

Method makeNumeric

external/.qrcodegen.js:309–317  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

307 return new s(s.Mode.BYTE, t.length, e)
308 }
309 static makeNumeric(t) {
310 if (!s.isNumeric(t)) throw new RangeError("String contains non-numeric characters")
311 let e = []
312 for (let n = 0; n < t.length; ) {
313 const o = Math.min(t.length - n, 3)
314 r(parseInt(t.substring(n, n + o), 10), 3 * o + 1, e), (n += o)
315 }
316 return new s(s.Mode.NUMERIC, t.length, e)
317 }
318 static makeAlphanumeric(t) {
319 if (!s.isAlphanumeric(t)) throw new RangeError("String contains unencodable characters in alphanumeric mode")
320 let e,

Callers 1

makeSegmentsMethod · 0.80

Calls 3

isNumericMethod · 0.80
minMethod · 0.80
rFunction · 0.70

Tested by

no test coverage detected