1

Could somebody help me with 'ipfs-only-hash'? I'm pretty new with JavaScript and do not know how to add it to my html and js files...

I need to calculate an IPFS hash of the image file (for example, upload with <input type="file" ..>). What I found is 'ipfs-only-hash', and its possible implementation (here - hash of the string):

const Hash = require('ipfs-only-hash')
Hash.of('hi').then(console.log)

But I got all the time errors on "require", tried to change it to 'import Hash from "ipfs-only-hash"', and again got errors... Where and how should I use it in my html-js files?

Nflv22
  • 29
  • 1

0 Answers0