Just enough code to calculate the IPFS hash for some data
npm install @arcblock/ipfs-only-hashJust enough code to calculate the IPFS hash for some data
``sh`
npm install @arcblock/ipfs-only-hash
`js``
const { onlyHash } = require('@arcblock/ipfs-only-hash')
const data = 'hello world!';
const hash = await onlyHash(data);
console.log(hash); // QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j