MCPcopy Create free account
hub / github.com/Levofron/NotionLingo / decrypt

Function decrypt

server/utils/decrypt/decrypt.function.ts:7–20  ·  view source on GitHub ↗
(hash: Hash)

Source from the content-addressed store, hash-verified

5import { Hash } from './decrypt.type';
6
7export const decrypt = (hash: Hash) => {
8 const decipher = crypto.createDecipheriv(
9 CRYPTO_ALGORITHM,
10 CRYPTO_SECRET_KEY,
11 Buffer.from(hash.iv, 'hex'),
12 );
13
14 const decrypted = Buffer.concat([
15 decipher.update(Buffer.from(hash.content, 'hex')),
16 decipher.final(),
17 ]);
18
19 return decrypted.toString();
20};

Callers 6

handlerFunction · 0.90
handlerFunction · 0.90
handlerFunction · 0.90
getDatabasePagesFunction · 0.90
decrypt.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected