"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHashBucketHex = exports.getHashBucket = exports.simpleHash = exports.covertToPascalCase = void 0;
const covertToPascalCase = (str) => {
    return str.replace(/-([a-z0-9])/g, (_, char) => char.toUpperCase()).replace(/^[a-z]/, (char) => char.toUpperCase());
};
exports.covertToPascalCase = covertToPascalCase;
/**
 * 간단한 해시 함수 - 문자열을 숫자로 변환
 */
const simpleHash = (str) => {
    let hash = 0;
    for (let i = 0; i < str.length; i++) {
        const char = str.charCodeAt(i);
        hash = (hash << 5) - hash + char;
        hash = hash & hash; // 32비트 정수로 변환
    }
    return Math.abs(hash);
};
exports.simpleHash = simpleHash;
/**
 * 아이콘 이름을 해시 버킷 인덱스로 변환 (0-15)
 */
const getHashBucket = (iconName, bucketCount = 16) => {
    return (0, exports.simpleHash)(iconName) % bucketCount;
};
exports.getHashBucket = getHashBucket;
/**
 * 해시 버킷 인덱스를 16진수 문자열로 변환 (0-f)
 */
const getHashBucketHex = (iconName, bucketCount = 16) => {
    return (0, exports.getHashBucket)(iconName, bucketCount).toString(16);
};
exports.getHashBucketHex = getHashBucketHex;
