(encodedChar)
| 252 | return text.replace(shouldEncodePattern, " " + _encode(matches[1])); |
| 253 | }; |
| 254 | const decodeChar = (encodedChar) => { |
| 255 | encodedChar = encodedChar.reverse(); |
| 256 | let curr = 1; |
| 257 | let charCode = 0; |
| 258 | for (let digit of encodedChar) { |
| 259 | charCode += digit * curr; |
| 260 | curr *= BASE; |
| 261 | } |
| 262 | return String.fromCodePoint(charCode); |
| 263 | }; |
| 264 | const _decode = (s) => { |
| 265 | s = encodedPattern.exec(s)[1]; |
| 266 | let curr = []; |