Skip to content

Proper use of encoding for hashing international characters.#7

Open
michaellopez wants to merge 1 commit into
chrisdanford:masterfrom
michaellopez:encoding
Open

Proper use of encoding for hashing international characters.#7
michaellopez wants to merge 1 commit into
chrisdanford:masterfrom
michaellopez:encoding

Conversation

@michaellopez
Copy link
Copy Markdown

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-ver 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.

PS. This plugin could use a bit of refactoring to allow passing options and such. My PR only handles the encoding bit though.

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

Successfully merging this pull request may close these issues.

1 participant