performance and optimization

This commit is contained in:
Ben
2026-06-09 17:13:27 -04:00
parent efbd95e464
commit 1c5a3d9a94
13 changed files with 284 additions and 48 deletions
+15
View File
@@ -0,0 +1,15 @@
import * as crypto from 'crypto';
import { hash256 } from './hash.utils';
describe('hash256', () => {
it('matches native double sha256 for known input', () => {
const data = Buffer.from('public-pool-share-validation', 'utf8');
const expected = crypto
.createHash('sha256')
.update(crypto.createHash('sha256').update(data).digest())
.digest('hex');
expect(hash256(data).toString('hex')).toBe(expected);
});
});