Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash is wrong if the file is "big" #30

Open
itnok opened this issue Mar 20, 2015 · 0 comments
Open

Hash is wrong if the file is "big" #30

itnok opened this issue Mar 20, 2015 · 0 comments

Comments

@itnok
Copy link

itnok commented Mar 20, 2015

On "big" files (I am having this problem on a Js file just slightly bigger than 1MB) the calculated hash is definitely wrong.

With smaller files no problem though.
Is it possible that if a file is big enough only a chunk of the file is used?

On my file, for example, these are the results:

  • Using grunt-rev (options: {algorithm: md5, length: 32}): 9e494b97b63d7e67833df32376b4bb2b
  • Using cat scripts.min.js | openssl md5: 36cd285cd1271348628d496c3735b179
itnok added a commit to itnok/grunt-rev that referenced this issue Mar 20, 2015
…orrectly calculated)

The `fs` library is already included and it looks like it works better than `grunt.file`.

With files bigger than few kilobytes the hash is calculated in the right way.
It looks like `grunt.file.read` either does not read the file correctly or not in full.

This change solves Issue sebdeckers#30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant