simple tool to encode/decode content hash for EIP 1577 compliant ENS Resolvers (fork of pldespaigne/content-hash)
Usage no npm install needed!
<script type="module">
import ensdomainsContentHash from 'https://cdn.skypack.dev/@ensdomains/content-hash';
</script>
README
content-hash
This is a simple package made for encoding and decoding content hashes as specified in the EIP 1577.
This package will be useful for every Ethereum developer wanting to interact with EIP 1577 compliant ENS resolvers.
To rebuild the browser version of the package run npm run build into the root folder. Don't forget to also run npm run lint and npm test before building !
📕 API
All hex string inputs can be prefixed with 0x, but it's not mandatory.
⚠️ All outputs are NOT prefixed with 0x
contentHash.decode( contentHash ) -> string
This function takes a content hash as a hex string and returns the decoded content as a string.
For any questions, discussions, bug report, or whatever I will be happy to answer through the issues or on my twitter 😁. PR (with tests) are also welcome !
📝 License
This project is licensed under the ISC License, you can find it here.
Note that the dependencies may have a different License