Coder Social home page Coder Social logo

hash-files's Issues

Unable to pass array of files from cli

image

Command:

hash-files -f '["package.json"]'

Expected:

Hash the array of files

Actual:

Error: Option "files" has a value that cannot be converted to an Object/Array: '[package.json]'

System:
OS: Windows 11 x64
CLI: CMD
Node.js: v18.9.1

Nodejs crypto OpenSSL version

Would the OpenSSL version per environment cause issues in the underlying crypto module that hash-files uses? Let's say I use hash-files to md5 a folder of files on one platform and do the same thing with the same content on another platform. Would OpenSSL differences cause a difference in the md5 hash?

hashFiles is not defined

I'm trying to get hash of a file but it doesn't work.

this is my code :
hashFiles({"files":'/path/to/my/file', "algorithm":'sha256'}, function(error, hash){
if (error) throw error;
console.log(hash);
});

abd into server.js
I added this : var hashFiles = require('hash-files');

Sub-directory exclusion while generating hash for directory

I have to generate hash for a directory with some of the sub-directory or files are excluded

For e.g. There is a directory

/path/to/dir/abc/

This Directory has following sub directories & file

  • foo
  • bar
  • secrets.txt

I don't want to include bar directory while creating hash for directory 'abc'

So, please provide a way we can exclude directory or file while generating hash of a directory.

ps:: we can use glob-all instead of glob to get the path of the directory.

Concatenating files can generate same hash?

As far as I understand, this works by concatenating all of the files together and then hashing the result. Does this mean that we can get the same hash when hashing this:

File 1: 00 01 02
File 2: 03 04 05

As well as this?

File 1: 00 01 02 03
File 2: 04 05

Error on the example format

As example, the command should be like:
$ ./bin/hash-files -f '["package.json"]' -a sha256

But it would throw an error said Option "files" has a value that cannot be converted to an Object/Array: [package.json].

It should be $ ./bin/hash-files -f '[\"package.json\"]' -a sha256 instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.