dathoangnd / truedevtools.com

All-in-one Toolkit for Developers
https://truedevtools.com
39 stars 0 forks source link

Base64 only works on charset UTF-16LE #4

Closed kokoropie closed 4 months ago

kokoropie commented 4 months ago

This must be done to see the problem

  1. Go to truedevtools.com
  2. Select Base64 Encoder / Decoder
  3. Select "Decode"
  4. Try some encoded eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 (which used UTF-8 for {"alg":"HS256","typ":"JWT"})
  5. Get error
dathoangnd commented 4 months ago

@kokoropie Fixed it now. Since I do not want to add another dropdown just to select the encoding, I have come up with a heuristic algorithm to detect the source encoding, and it works well for most cases.

Screenshot 2024-05-04 at 12 33 15

kokoropie commented 4 months ago

works well now