fasthash
Calculate hashes for files and directories the streaming way
Last updated 4 years ago by tonbert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fasthash 
SYNC missed versions from official npm registry.

fasthash

Calculate hashes for files and directories the streaming way

Example

var fasthash = require("./fasthash");

// Defaults
var options = {
    algorithm: 'md5',
    relative: true 
};

// Usage: fasthash.file(filePath, [options], onComplete)
fasthash.file("testdata/index.html", options, function(error, hash) {
    if(error) {
        console.log(error);
    }
    console.log(hash);
    // a6febb912da51bcbcc443fc658c76c3d
});

// Usage: fasthash.file(dirPath, [options], onComplete)
fasthash.directory("testdata", options, function(hashes) {
    console.log(hashes);
    //  {
    //      'testdata/Dokumentation.pdf': 'a7b638e4e2cf0aa0cb945db4481da807',
    //      'testdata/index.html': 'a6febb912da51bcbcc443fc658c76c3d',
    //      'testdata/vendor/animate.min.css': '60aca30e688004a84ab7c554d257e527',
    //      ...
    //  }
});

Current Tags

  • 0.2.0                                ...           latest (4 years ago)

2 Versions

  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (1)
Dev Dependencies (0)
None

Copyright 2014 - 2017 © taobao.org |