sebdeckers / grunt-rev

:punch: Asset revving for Grunt.js
MIT License
240 stars 54 forks source link

Proper use of encoding for hashing international characters. #4

Closed michaellopez closed 11 years ago

michaellopez commented 11 years ago

The documentation for hash.update() states that if no encoding is given, the argument is expected to be a Buffer.

Like many other "hash tasks" for Grunt, grunt-md5 provides the contents of the file as a string to hash.update without any encoding as a second argument, which is incorrect.

The result of this is an incorrect hash for files with international characters in them when no encoding is given to hash.update.

Setting the proper encoding when calling hash.update fixes this.

sebdeckers commented 11 years ago

Thanks! :heart: