All files / src/crypto/ripemd160 ripemd160-minimal.ts

83.33% Statements 5/6
50% Branches 1/2
100% Functions 1/1
83.33% Lines 5/6

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 1342x 42x       42x 150x     150x      
import { ripemd160 as baseRipemd160 } from '@noble/hashes/ripemd160';
import { ensureUint8Array } from 'micro-stacks/common';
 
export default function ripemd160(message: Uint8Array): Uint8Array;
export default function ripemd160(message: string): string;
export default function ripemd160(message: string | Uint8Array): string | Uint8Array {
  Iif (typeof message === 'string') {
    return baseRipemd160(message);
  } else {
    return baseRipemd160.create().update(ensureUint8Array(message)).digest();
  }
}