Files
pezkuwi-extension/packages/extension-inject/src/cyrb53.spec.ts
T
pezkuwichain 5d54192e6d chore: update copyright years to 2026 and fix lint issues
- Update all copyright headers from 2025 to 2026
- Fix @polkadot references to @pezkuwi in config files
- Fix eslint.config.js import path

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 01:22:46 +03:00

31 lines
1.0 KiB
TypeScript

// Copyright 2019-2026 @pezkuwi/extension-inject authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type * as _ from '@pezkuwi/dev-test/globals.d.ts';
import { cyrb53 } from './cyrb53.js';
const TESTS = [
{ input: 'a', seed: 0, test: '501c2ba782c97901' },
{ input: 'b', seed: 0, test: '459eda5bc254d2bf' },
{ input: 'revenge', seed: 0, test: 'fbce64cc3b748385' },
{ input: 'revenue', seed: 0, test: 'fb1d85148d13f93a' },
{ input: 'revenue', seed: 1, test: '76fee5e6598ccd5c' },
{ input: 'revenue', seed: 2, test: '1f672e2831253862' },
{ input: 'revenue', seed: 3, test: '2b10de31708e6ab7' }
] as const;
describe('cyrb53', (): void => {
for (let i = 0, count = TESTS.length; i < count; i++) {
const { input, seed, test } = TESTS[i];
it(`correctly encodes ${input}`, (): void => {
// expected values, known input & seed
expect(cyrb53(input, seed)).toEqual(test);
// seed set as Date.now(), should not match previous
expect(cyrb53(input)).not.toEqual(test);
});
}
});