You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first off, thank you for putting this together. Must have been a lot of work!
I ran into a small problem when I was trying to decode the following base64url encoded value:
bytes n = hex'736775494b49766c4556427345476b3737695632794e517870595f516b69793379754d66593477706d6e506c65766c444b4153753675505f434775627a54686942486c43685944444e7659664f6974575844777078624a5f4d716d616a412d6444627249354c646767794a70536f57504b5468504a31434b5268526952584a6a5847693647673654666259527775307a697944675a5a3132354e737a754e4f554f317063317147756e34535069667a59374f5936427441445a44715457484654666d5f796867426779456c452d7234642d5a7150653974595971436e4176494c42755a6250597433554333664172394a6c7464554f353476784b626c6f327a3266642d48397a426e396a525a4f426b7556564238515356357372652d483233435442414253705a70653053724a705867473941755634446137465248424339412d6f4c594c652d5546355f3563365f636437635f4b51';
It's almost correct, but the last 2 characters in the hex representation seem to be missing. I tried decoding the same value on https://cryptii.com/pipes/base64-to-hex and the result is almost the same. However, there are 2 extra characters 29 at the end.
So, I looked at your code and changed this line
// When decoding base64 string, 4 characters are converted back to 3 bytes, skip padding "="
uint256 decodedLength = (data.length / 4) * 3;
This solved the issue for me. I'm not sure why this last byte was missing but I thought I'd let you know and leave this here just in case anyone else is having issues with this.
Again, thank you for providing this library! Really appreciate your work!
The text was updated successfully, but these errors were encountered:
Hi @hir0min,
first off, thank you for putting this together. Must have been a lot of work!
I ran into a small problem when I was trying to decode the following base64url encoded value:
Your library gives me the following result"
It's almost correct, but the last 2 characters in the hex representation seem to be missing. I tried decoding the same value on https://cryptii.com/pipes/base64-to-hex and the result is almost the same. However, there are 2 extra characters
29
at the end.So, I looked at your code and changed this line
to this:
This solved the issue for me. I'm not sure why this last byte was missing but I thought I'd let you know and leave this here just in case anyone else is having issues with this.
Again, thank you for providing this library! Really appreciate your work!
The text was updated successfully, but these errors were encountered: