MCPcopy Create free account
hub / github.com/binux/qiandao / digitToBasic

Function digitToBasic

web/static/node_components.js:1623–1627  ·  view source on GitHub ↗

* Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range

(digit, flag)

Source from the content-addressed store, hash-verified

1621 * if `flag` is non-zero and `digit` has no uppercase form.
1622 */
1623 function digitToBasic(digit, flag) {
1624 // 0..25 map to ASCII a..z or A..Z
1625 // 26..35 map to ASCII 0..9
1626 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
1627 }
1628
1629 /**
1630 * Bias adaptation function as per section 3.4 of RFC 3492.

Callers 1

encodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected