From bf278971044fc281a583e0dab474dddd1c4fc3e7 Mon Sep 17 00:00:00 2001 From: Jorge Aceves Date: Thu, 19 Jul 2018 14:18:36 -0500 Subject: [PATCH] Remove ruby code when hashing on readme --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4b876c..39f2665 100644 --- a/README.md +++ b/README.md @@ -84,10 +84,16 @@ Mifiel.Config.url = 'https://sandbox.mifiel.com/api/v1' doc.file doc.file_signed }) + // if you dont want us to have the PDF, you can just send us // the original_hash and the name of the document. Both are required + const fs = require('fs'); + const crypto = require('crypto'); + const hash = crypto.createHash('sha256'); + + hash.update(fs.readFileSync('path/to/your_file')); const document = new Mifiel.Models.Document({ - hash: Digest::SHA256.hexdigest(File.read('path/to/my-file.pdf')), + hash: hash.digest('hex') name: 'my-file.pdf', signatories: [...] })