Files
meta-hash/dist/chunk-Y5FIE5OK.cjs.map
T
2024-04-16 10:09:36 +02:00

1 line
921 B
Plaintext

{"version":3,"sources":["../src/lib/file-id/ShaComputeWorker.ts"],"names":["computeCIDs"],"mappings":";;;;;AACA,OAAO,QAAQ;AASf,eAAOA,aAAmC,EAAC,UAAU,WAAU,GAGzC;AAClB,QAAM,SAAS,GAAG,iBAAiB,QAAQ;AAC3C,SAAO,YAAoB,EAAC,QAAQ,WAAU,CAAC;AACnD","sourcesContent":["import {CID_ALGORITHM_NAMES} from \"@root/hash-compute/MultiHashData\";\nimport fs from \"fs\";\nimport {computeCIDs as computeCIDsInternal} from \"./ComputeHash\";\n\n/**\n * Compute the CIDs of a file using specific algorithms\n * @param filePath The path to the file\n * @param algorithms Array of algorithms ('sha256', 'sha1')\n * @returns Array of CIDs (in the order of the algorithms)\n */\nexport default async function computeCIDs({filePath, algorithms}: {\n filePath: string;\n algorithms: CID_ALGORITHM_NAMES[]\n}): Promise<string[]> {\n const stream = fs.createReadStream(filePath);\n return computeCIDsInternal({stream, algorithms});\n}\n"]}