mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-16 14:18:29 +00:00
* cleanup scripts * Move helpers to package * Fixes scripts * Fix scripts * Formatting * Fix helpers import paths * Remove lucide-figma * Rename helpers package * Fix build * formatting * Adjust main build-icons file * Add export casing * Adds `exportModuleNameCasing` fro lab project * format files * Bump package version @lucide/build-icons * Revert changes in icons * Revert changes in PR yml * Fix lint issues * Fix site build * fix lint errors * Attempt fix linting * Fix lint errors
20 lines
479 B
JavaScript
20 lines
479 B
JavaScript
/* eslint-disable import/prefer-default-export */
|
|
/**
|
|
* djb2 hashing function
|
|
*
|
|
* @param {string} string
|
|
* @param {number} seed
|
|
* @returns {string} A hashed string of 6 characters
|
|
*/
|
|
export const hash = (string, seed = 5381) => {
|
|
let i = string.length;
|
|
|
|
while (i) {
|
|
// eslint-disable-next-line no-bitwise, no-plusplus
|
|
seed = (seed * 33) ^ string.charCodeAt(--i);
|
|
}
|
|
|
|
// eslint-disable-next-line no-bitwise
|
|
return (seed >>> 0).toString(36).substr(0, 6);
|
|
};
|