fastlion-amis
Version:
一种MIS页面生成工具
24 lines (23 loc) • 646 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHashCode = void 0;
/**
*
* @param str 字符串
* @param caseSensitive 是否小大写敏感
* @returns 返回哈希值
*/
//字符串哈希函数
function getHashCode(str, caseSensitive) {
if (!caseSensitive) {
str = str.toLowerCase();
}
var hash = 1315423911, i, ch;
for (i = str.length - 1; i >= 0; i--) {
ch = str.charCodeAt(i);
hash ^= ((hash << 5) + ch + (hash >> 2));
}
return (hash & 0x7FFFFFFF);
}
exports.getHashCode = getHashCode;
//# sourceMappingURL=./utils/utils.js.map
;