All files / src/hasher Sha512.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 111x     1x     14x 14x      
import { sha512 } from 'js-sha512';
import type { IHasher } from './IHasher';
 
export class Sha512 implements IHasher {
 
    public hash(data: Uint8Array): Uint8Array {
        const hash = sha512.create();
        return new Uint8Array(hash.update(data).arrayBuffer());
    }
}