inital commit

This commit is contained in:
dignifiedquire
2016-05-19 18:47:48 +02:00
commit 37edb7d0e4
13 changed files with 401 additions and 0 deletions

13
src/utils.js Normal file
View File

@ -0,0 +1,13 @@
'use strict'
const multihashing = require('multihashing')
// Check the equality of two keys
exports.keyEqual = (k1, k2) => {
return k1.buffer.equals(k2.buffer)
}
// Hashes a key
exports.keyHash = (key) => {
return multihashing(key.buffer, 'sha2-256')
}