ezcss
Version:
Super lite CSS-in-JS
17 lines (16 loc) • 494 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var stableStringify_1 = require("fast-af/stableStringify");
exports.hash = function (str) {
var hash = 5381, i = str.length;
while (i) {
hash = (hash * 33) ^ str.charCodeAt(--i);
}
return hash >>> 0;
};
function hashStyles(styles) {
var str = stableStringify_1.stableStringify(styles);
var res = exports.hash(str).toString(36);
return '_' + res;
}
exports.hashStyles = hashStyles;
;