Opal-Estate-Pro/node_modules/postcss-reduce-idents/dist/lib/encode.js

22 lines
649 B
JavaScript
Raw Normal View History

2019-09-13 06:27:52 +02:00
'use strict';
exports.__esModule = true;
exports.default = encode;
function encode(val, num) {
var base = 52;
var characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var character = num % base;
var result = characters[character];
var remainder = Math.floor(num / base);
if (remainder) {
base = 64;
characters = characters + '0123456789-_';
while (remainder) {
character = remainder % base;
remainder = Math.floor(remainder / base);
result = result + characters[character];
}
}
return result;
};
module.exports = exports['default'];