js-spark-md5 icon indicating copy to clipboard operation
js-spark-md5 copied to clipboard

fix(toUTF8): replace deprecated unescape with decodedURIComponent

Open cachelina opened this issue 2 years ago • 3 comments

This PR updates the toUTF8 function to use decodedURIComponent, instead of the deprecated unescape as suggested here MDN.

cachelina avatar Dec 27 '22 11:12 cachelina

Hey! The changes in this PR are giving wrong md5 results unfortunately. :/

satazor avatar Dec 28 '22 21:12 satazor

Hey! The changes in this PR are giving wrong md5 results unfortunately. :/

Hey! I’ll take a look at this again :) I thought decodeURIComponent had the correct encodings to begin with, and that’s why I updated the tests.

cachelina avatar Dec 28 '22 21:12 cachelina

Hey @satazor I just pushed up some changes. Specifically, I reimplemented the native unescape from V8. I noticed there were a few functions responsible for converting characters to hex in the codebase.

However, I wasn't sure which one would accomplish what I needed, so I ported the hexing function from V8. Let me know your thoughts 🙂

cachelina avatar Jan 03 '23 05:01 cachelina