MCPcopy
hub / github.com/kciter/qart.js / getCode

Function getCode

src/qrcode.js:1476–1496  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

1474 }
1475
1476 var getCode = function (c) {
1477 if (c >= '0' && c <= '9') {
1478 return c.charCodeAt(0) - '0'.charCodeAt(0)
1479 } else if (c >= 'A' && c <= 'Z') {
1480 return c.charCodeAt(0) - 'A'.charCodeAt(0) + 10
1481 } else {
1482 switch (c) {
1483 case ' ' : return 36
1484 case '$' : return 37
1485 case '%' : return 38
1486 case '*' : return 39
1487 case '+' : return 40
1488 case '-' : return 41
1489 case '.' : return 42
1490 case '/' : return 43
1491 case ':' : return 44
1492 default :
1493 throw 'illegal char :' + c
1494 }
1495 }
1496 }
1497
1498 return _this
1499 }

Callers 1

qrAlphaNumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected