Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
at main 507 B view raw
1import { HashValue, phash } from './hash'; 2import { expect, it } from 'vitest'; 3 4it('hashes given strings', () => { 5 expect(phash('hello')).toMatchInlineSnapshot('261238937'); 6}); 7 8it('hashes given strings and seeds', () => { 9 let hash: HashValue; 10 expect((hash = phash('hello'))).toMatchInlineSnapshot('261238937'); 11 expect((hash = phash('world', hash))).toMatchInlineSnapshot('-152191'); 12 expect((hash = phash('!', hash))).toMatchInlineSnapshot('-5022270'); 13 expect(typeof hash).toBe('number'); 14});