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

Method makeAlphanumeric

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

Source from the content-addressed store, hash-verified

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,
321 n = []
322 for (e = 0; e + 2 <= t.length; e += 2) {
323 let o = 45 * s.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e))
324 ;(o += s.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e + 1))), r(o, 11, n)
325 }
326 return e < t.length && r(s.ALPHANUMERIC_CHARSET.indexOf(t.charAt(e)), 6, n), new s(s.Mode.ALPHANUMERIC, t.length, n)
327 }
328 static makeSegments(t) {
329 return "" == t ? [] : s.isNumeric(t) ? [s.makeNumeric(t)] : s.isAlphanumeric(t) ? [s.makeAlphanumeric(t)] : [s.makeBytes(s.toUtf8ByteArray(t))]
330 }

Callers 1

makeSegmentsMethod · 0.80

Calls 3

isAlphanumericMethod · 0.80
indexOfMethod · 0.80
rFunction · 0.70

Tested by

no test coverage detected