@taqueria/plugin-ipfs-pinata
Version:
A plugin for Taqueria providing ipfs publishing and pinning using the Pinata service
1 lines • 755 B
Source Map (JSON)
{"version":3,"sources":["ipfsHash.ts"],"sourcesContent":["import { createHash } from 'crypto';\nimport { readFile } from 'fs/promises';\n\nexport async function getFileIPFSHash(filePath: string): Promise<string> {\n\t// Read the file contents\n\tconst fileContent = await readFile(filePath);\n\n\t// Create a SHA-256 hash of the file contents\n\tconst hash = createHash('sha256').update(fileContent).digest('hex');\n\n\t// Return the hash as a string\n\treturn hash;\n}\n\nexport default getFileIPFSHash;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAC3B,sBAAyB;AAEzB,eAAsB,gBAAgB,UAAmC;AAExE,QAAM,cAAc,UAAM,0BAAS,QAAQ;AAG3C,QAAM,WAAO,0BAAW,QAAQ,EAAE,OAAO,WAAW,EAAE,OAAO,KAAK;AAGlE,SAAO;AACR;AAEA,IAAO,mBAAQ;","names":[]}