Skip to content

Commit

Permalink
feat: [IOPID-1296] Add hashFiscalCode utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacavallaro committed Jan 8, 2024
1 parent 039f20b commit 8d4640d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/hash.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as crypto from "crypto";

import { FiscalCode } from "./strings";

export const hashFiscalCode = (fiscalCode: FiscalCode): string => {
const hash = crypto.createHash("sha256");
hash.update(fiscalCode);
return hash.digest("hex");
};

0 comments on commit 8d4640d

Please sign in to comment.