mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
12 lines
384 B
TypeScript
12 lines
384 B
TypeScript
import { createHash, createKeyedHash, Hash, KeyedHash } from 'blake2';
|
|
|
|
const fakeKey = Buffer.alloc(0);
|
|
const keyedHash: KeyedHash = createKeyedHash('blake2b', fakeKey);
|
|
|
|
keyedHash.update(Buffer.alloc(0)).digest();
|
|
|
|
const regularHash: Hash = createHash('blake2s', { digestLength: 256 });
|
|
const regularHashViaCtor: Hash = new Hash('blake2bp');
|
|
|
|
const copy: Hash = regularHash.copy();
|