(t)
| 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 | } |
no test coverage detected