Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [...]
})
Expand Down