PatrickJS / angular-md5

md5 for Angular.js and Gravatar filter
MIT License
132 stars 55 forks source link

encrypt not the same with backend use java,did any params about encoding pass to md5.createHash function #18

Open dribehance opened 8 years ago

dribehance commented 8 years ago

hi,i use the lib to encrypt my request param to server ,but when it come to chinese ,the result is not the same with the backend use java md5

rquadling commented 8 years ago

Currently, the md5.createHash() method in angular-md5 forces the content to lowercase before hashing. I think this is a cut and paste error from using the Gravatar API.

See https://github.com/gdi2290/angular-md5/pull/15 for an outstanding pull request.

Some options for you.

  1. Manually patch your angular-md5.js / angular-md5.min.js.
  2. Lower case your strings before calling the java md5.

If you do try step 2 and the code starts working correctly, I'd try step 1 and not step 2.

I'm not the author of this project, just another user.