hashをパスと行数から決定
This commit is contained in:
@@ -35,7 +35,7 @@ const externalPackages = [
|
||||
},
|
||||
];
|
||||
|
||||
const hash = (str: string, seed = 0): number => {
|
||||
export const hash = (str: string, seed = 0): number => {
|
||||
let h1 = 0xdeadbeef ^ seed,
|
||||
h2 = 0x41c6ce57 ^ seed;
|
||||
for (let i = 0, ch; i < str.length; i++) {
|
||||
@@ -50,9 +50,9 @@ const hash = (str: string, seed = 0): number => {
|
||||
return 4294967296 * (2097151 & h2) + (h1 >>> 0);
|
||||
};
|
||||
|
||||
const BASE62_DIGITS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
export const BASE62_DIGITS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
|
||||
function toBase62(n: number): string {
|
||||
export function toBase62(n: number): string {
|
||||
if (n === 0) {
|
||||
return '0';
|
||||
}
|
||||
|
Reference in New Issue
Block a user