(char)
| 224 | const BASE = CHARS.length; |
| 225 | const LEN = lenCalc(BASE, UNICODE_CHARS); |
| 226 | const charConvert = (char) => { |
| 227 | let charCode = char.codePointAt(0); |
| 228 | let arr = []; |
| 229 | while (charCode > 0) { |
| 230 | arr.push(charCode % BASE); |
| 231 | charCode = ~~(charCode / BASE); |
| 232 | } |
| 233 | while (arr.length < LEN) { |
| 234 | arr.push(0); |
| 235 | } |
| 236 | return arr.reverse(); |
| 237 | }; |
| 238 | const charEncode = (convertedChar) => { |
| 239 | return convertedChar.reduce((curr, digit) => curr + CHARS[digit], ""); |
| 240 | }; |