Last active
March 27, 2019 22:16
-
-
Save makoto/c1f2c987dc45a6cbb65b9f1040eff5c4 to your computer and use it in GitHub Desktop.
contenthash
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
const namehash = require('eth-ens-namehash').hash | |
document.querySelector('input').value = 'matoken.eth' | |
window.namehash = namehash | |
var sayHello = function(){ | |
var name = document.querySelector('input').value | |
console.log(namehash(name)) | |
} |
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
{ | |
"name": "requirebin-sketch", | |
"version": "1.0.0", | |
"dependencies": { | |
"eth-ens-namehash": "2.0.8" | |
} | |
} |
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
<script> | |
var sayHello = function(){ | |
var name = document.querySelector('input').value | |
document.querySelector('.answer').textContent = window.namehash(name) | |
} | |
</script> | |
<h1>ENS to Namehash</h1> | |
<input placeholder="eg: matoken.eth"></input> | |
<button onClick="sayHello()" >hash it!</button> | |
<hr/> | |
<div class="answer"><div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment