UNPKG

@hadss/hmrouter-plugin

Version:

HMRouter Compiler Plugin

19 lines (18 loc) 481 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StringUtil = void 0; class StringUtil { static stringToHashCode(str) { let hash = 0; if (str.length === 0) { return hash; } for (let i = 0; i < str.length; i++) { const char = str.charCodeAt(i); hash = (hash << 5) - hash + char; hash |= 0; } return hash; } } exports.StringUtil = StringUtil;