UNPKG

charset-pl

Version:

polish charset? idk

11 lines (10 loc) 539 B
"use strict"; var chars_1 = require("./tools/chars"); var toBinary_1 = require("./tools/toBinary"); var split_1 = require("./tools/split"); module.exports = function (s) { if (!s) return ''; var hexarray = s instanceof Buffer ? split_1.default(s.toString('hex'), 2) : (s.includes(' ') ? s.split(' ') : split_1.default(s, 2)); return split_1.default(hexarray.map(function (hex) { return toBinary_1.default(parseInt(hex, 16), 8); }).join(''), 6).map(function (s) { return chars_1.default[parseInt(s, 2)]; }).join(''); };