Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
hash.ts 208 B
export const stringToHash = (text: string): number => {
    let hash = 0;

    if (text.length === 0) return hash;

    for (const char of text) {
        hash ^= char.charCodeAt(0);
    }

    return hash;
}