First test passing

master
Dan Finlay 8 years ago
parent 679a7ef7ce
commit e6ad659a6c
No known key found for this signature in database
GPG Key ID: 931102F24B36007A

@ -18,17 +18,14 @@ module.exports = function namehash (inputName) {
const name = normalize(inputName) const name = normalize(inputName)
const split = name.split('.') const split = name.split('.')
const label = toBuffer(split.shift()) const label = split.shift()
const remainder = toBuffer(split.join('.')) const remainder = split.join('.')
console.log('finishing with ', typeof sha3(label)) console.log('finishing with ', typeof sha3(label))
console.log(sha3(label)) console.log(sha3(label))
const result = sha3(namehash(remainder) + sha3(label)) return sha3(namehash(remainder) + sha3(label))
console.dir(result)
throw new Error('stop')
return result
} }
/* /*
@ -40,7 +37,3 @@ function sha3 (input) {
function normalize(name) { function normalize(name) {
return uts46.toUnicode(name, {useStd3ASCII: true, transitional: false}); return uts46.toUnicode(name, {useStd3ASCII: true, transitional: false});
} }
function toBuffer(str) {
return new Buffer(str, 'utf8')
}

Loading…
Cancel
Save