From e6ad659a6cc9ff94bbb32600664d979ffd2d4901 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 7 Mar 2017 17:10:26 -0800 Subject: [PATCH] First test passing --- index.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index c0eb375..387d0b4 100644 --- a/index.js +++ b/index.js @@ -18,17 +18,14 @@ module.exports = function namehash (inputName) { const name = normalize(inputName) const split = name.split('.') - const label = toBuffer(split.shift()) - const remainder = toBuffer(split.join('.')) + const label = split.shift() + const remainder = split.join('.') console.log('finishing with ', typeof sha3(label)) console.log(sha3(label)) - const result = sha3(namehash(remainder) + sha3(label)) - console.dir(result) - throw new Error('stop') - return result + return sha3(namehash(remainder) + sha3(label)) } /* @@ -40,7 +37,3 @@ function sha3 (input) { function normalize(name) { return uts46.toUnicode(name, {useStd3ASCII: true, transitional: false}); } - -function toBuffer(str) { - return new Buffer(str, 'utf8') -}