diff --git a/packages/shared/src/hash.js b/packages/shared/src/hash.js index bc8be503d..ef8370187 100644 --- a/packages/shared/src/hash.js +++ b/packages/shared/src/hash.js @@ -73,15 +73,18 @@ const hash = (str: string): string => murmurhash2_32_gc(str, 1).toString(36); export default hash as (str: string) => string; -const base62Chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; -function toBase62(num) { +const base62Chars = + '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; +function toBase62(num: number) { let result = ''; - while (num > 0) { - const remainder = num % 62; + let _num = num; + while (_num > 0) { + const remainder = _num % 62; result = base62Chars[remainder] + result; - num = Math.floor(num / 62); + _num = Math.floor(_num / 62); } return result; } -export const createShortHash = (str: string): string => toBase62(murmurhash2_32_gc(str, 1) % (62 ** 5)) +export const createShortHash = (str: string): string => + toBase62(murmurhash2_32_gc(str, 1) % 62 ** 5); diff --git a/packages/shared/src/stylex-create.js b/packages/shared/src/stylex-create.js index ca7913c4f..c36f85065 100644 --- a/packages/shared/src/stylex-create.js +++ b/packages/shared/src/stylex-create.js @@ -15,7 +15,8 @@ import type { } from './common-types'; import type { ComputedStyle, IPreRule } from './preprocess-rules/PreRule'; -import createHash, { createShortHash } from './hash'; +// import createHash from './hash'; +import { createShortHash } from './hash'; import { IncludedStyles } from './stylex-include'; import { defaultOptions } from './utils/default-options'; import { flattenRawStyleObject } from './preprocess-rules/flatten-raw-style-obj';