@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
15 lines (14 loc) • 735 B
JavaScript
"use client";
const require_css_object_to_string = require("./css-object-to-string/css-object-to-string.cjs");
//#region packages/@mantine/core/src/core/InlineStyles/hash-styles.ts
function djb2Hash(str) {
let hash = 5381;
for (let i = 0; i < str.length; i++) hash = (hash << 5) + hash + str.charCodeAt(i) & 4294967295;
return (hash >>> 0).toString(36);
}
function hashStyleProps(styles, media) {
return `__mdi__-${djb2Hash(`${styles ? require_css_object_to_string.cssObjectToString(styles) : ""}|${Array.isArray(media) ? media.map((m) => `${m.query}:${require_css_object_to_string.cssObjectToString(m.styles)}`).join("|") : ""}`)}`;
}
//#endregion
exports.hashStyleProps = hashStyleProps;
//# sourceMappingURL=hash-styles.cjs.map