I am writing a JUnit test to see if the java.util.Base64 function works the same as the sun.misc.BASE64 version. I am almost 100% certain they are identical enough for my purposes, but I'm working in a large enough codebase in a large enough company that if I make even a small change in our code I should write a test for it. So I've made a test that encodes a given string using sun.misc.BASE64 method, and decodes using java.util.Base64, and then compares the original and final strings.
Unsurprisingly, for every string I've attempted, the original string and the final string have been identical. It would seem that java.util.Base64 works the same as sun.misc.BASE64.
However for the sake of writing a better test I'd like to use a string (or anything) that when encoded, is encoded in all 64 glyphs. I don't know enough about base64 encoding to write such a string. Does anybody know of something that I could encode in sun.misc.BASE64 and decode in java.util.Base64 that will ensure that the two methods are treating all 64 glyphs the same?
Aucun commentaire:
Enregistrer un commentaire