UNPKG

@nextcloud/vue

Version:
21 lines (20 loc) 531 B
import { G as p } from "../chunks/GenColors-85cb6194.mjs"; import u from "md5"; const h = function(s) { let t = s.toLowerCase(); t.match(/^([0-9a-f]{4}-?){8}$/) === null && (t = u(t)), t = t.replace(/[^0-9a-f]/g, ""); const o = 6, f = p(o); function c(r, l) { let a = 0; const e = []; for (let n = 0; n < r.length; n++) e.push(parseInt(r.charAt(n), 16) % 16); for (const n in e) a += e[n]; return parseInt(parseInt(a, 10) % l, 10); } return f[c(t, o * 3)]; }; export { h as default };