diff --git a/backend/src/utils/dataHasher.ts b/backend/src/utils/dataHasher.ts deleted file mode 100644 index 849e0954..00000000 --- a/backend/src/utils/dataHasher.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { create } from 'multiformats/hashes/digest' -import { CID } from 'multiformats/cid' -import * as raw from 'multiformats/codecs/raw' -import { hash } from 'blake3' - -export const hashData = ( - data: string | Buffer, - algorithm: string = 'blake3', -): CID => { - if (algorithm != 'blake3') { - throw new Error('Invalid algorithm') - } - - return CID.create(1, raw.code, create(0x1f, hash(data))) -} diff --git a/backend/src/utils/index.ts b/backend/src/utils/index.ts index 7ee5c6f8..390c5f47 100644 --- a/backend/src/utils/index.ts +++ b/backend/src/utils/index.ts @@ -1,3 +1,2 @@ -export { hashData } from './dataHasher.js' export { isJson } from './misc.js' export { safeCallback } from './safe.js'