This file contains hidden or 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
0x2611a2A8489b104BE82d31f5dc4118a5Af1eAA69 |
This file contains hidden or 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 fs = require('fs').promises; | |
const { SHA3 } = require('sha3'); | |
const imageHash = async (imageFilePath) => { | |
const fileContent = await fs.readFile(imageFilePath); | |
const base64FileContent = fileContent.toString('base64'); | |
const hash = SHA3(256); | |
hash.update(base64FileContent); | |
return hash.digest({ buffer: Buffer.alloc(32), format: 'hex' }); | |
}; |
OlderNewer