all files / src/ hashing.js

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8    1× 19× 19× 19×    
import {sha256} from "sha.js";
 
export function hash(data) {
  let hasher = new sha256();
  hasher.update(data, 'utf8');
  return hasher.digest();
}