At the company I work for, we have a class to convert to and from a Base64 string. When I first saw the code, I asked why you are not using the Convert.ToBase64String that comes with .NET?
Then I modified the body of the method to just call Convert.ToBase64String, but it does not generate the same string.
I tried using ASCII, UTF8, Unicode and UTF32.
I donβt remember exactly, but I think that ASCII generates a string with the same length, but some characters are different and others Enconding generate large strings.
Maybe our implementation was wrong, but I found a JavaScript implementation that matches ours.
Isn't Base64 Portable?
Edit: I found this on Wikipedia, but I don't know if that was the reason http://en.wikipedia.org/wiki/Base64#Implementations_and_history
Edit2 . I mentioned encodings because we convert the string to another. Then I need to first convert the original string to an array of bytes using some encoding
Felipe fujiy pessoto
source share