This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseExtraData(extraData) { | |
try { | |
const nullSep = extraData.indexOf(0); | |
if (nullSep == -1) | |
return null; | |
const nameBin = extraData.slice(0, nullSep); | |
const name = Nimiq.BufferUtils.toAscii(nameBin); | |
const addrBin = extraData.slice(nullSep + 1, nullSep + 21); | |
const addr = new Nimiq.Address(addrBin); | |
return { |