Skip to content

Commit

Permalink
Merge pull request #1879 from OriginTrail/v6/test-unit
Browse files Browse the repository at this point in the history
unit test setup
  • Loading branch information
djordjekovac authored Apr 1, 2022
2 parents 0238adf + 7deb28d commit e86f9cf
Show file tree
Hide file tree
Showing 4 changed files with 1,108 additions and 11,607 deletions.
14 changes: 14 additions & 0 deletions modules/CalculateHash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { sha3_256 } = require('js-sha3');

/**
* Calculating data hash of dataset using sha3-256.
* Returns data hash value
@param dataset for which is calculated data hash
*/
function calculateDataHash(dataset) {
return `0x${sha3_256(dataset, null, 0)}`;
}

module.exports = {
calculateDataHash,
};
Loading

0 comments on commit e86f9cf

Please sign in to comment.