-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
* Reads the bytes of a file and returns with a sha256
* @param file
* @returns
*/
async function readAsset(file: string) {
const bytes = await fs.readFile(file)
const hash = crypto.createHash('sha512')
hash.write(bytes)
await new Promise(r => hash.end(r))
const sha256 = hash.digest('hex')
This uses the sha512 hash algorithm but mentions sha256 in a number of places,
Metadata
Metadata
Assignees
Labels
No labels