All files / src/crypto/ripemd160 hashRipemd160.ts

100% Statements 8/8
100% Branches 0/0
100% Functions 3/3
100% Lines 8/8

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 11 12 13 14 15 16 17 18 19 20 2142x           42x   134x       42x 134x     42x 134x 134x    
import Ripemd160Polyfill from './ripemd160-minimal';
 
export interface Ripemd160Digest {
  digest(data: Uint8Array): Uint8Array;
}
 
export class Ripemd160PolyfillDigest implements Ripemd160Digest {
  digest(data: Uint8Array): Uint8Array {
    return Ripemd160Polyfill(data);
  }
}
 
export function createHashRipemd160() {
  return new Ripemd160PolyfillDigest();
}
 
export function hashRipemd160(data: Uint8Array) {
  const hash = createHashRipemd160();
  return hash.digest(data);
}