Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
6215daf4aa
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
18 lines (13 sloc) 384 Bytes
'use strict'
const crypto = require('crypto')
const { CODE_P2P } = require('./constants')
module.exports.getStardustMultiaddr = (ma) => {
const tuples = ma.stringTuples().filter((tuple) => {
if (tuple[0] === CODE_P2P) {
return true
}
})
// Get first id
return tuples[0][1]
}
module.exports.sha5 = (data) => crypto.createHash('sha512').update(data).digest()