Skip to content

Instantly share code, notes, and snippets.

@feulf
Created October 30, 2017 16:29
Show Gist options
  • Select an option

  • Save feulf/f0945fe6f77f3d0a77dffca6636dd267 to your computer and use it in GitHub Desktop.

Select an option

Save feulf/f0945fe6f77f3d0a77dffca6636dd267 to your computer and use it in GitHub Desktop.

Revisions

  1. feulf created this gist Oct 30, 2017.
    14 changes: 14 additions & 0 deletions OTS-info.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    const OpenTimestamps = require('javascript-opentimestamps');
    var fs = require('fs');

    fs.readFile('bitcoin.pdf.ots', 'utf8', (err, contents) => {
    const fileOts = Buffer.from(contents.toString('utf8'));
    const detached = OpenTimestamps.DetachedTimestampFile.deserialize(fileOts);
    const infoResult = OpenTimestamps.info(detached);
    console.log(infoResult)
    });

    fs.readFile('hello-world.txt.ots', 'utf8', (err, ots) => {
    const infoResult = OpenTimestamps.info(ots);
    console.log(infoResult)
    });