Base32 Encoding in C#, Java

Last summer, while working on my Google Summer of Code project, I needed a Base32 encoder in C# for the Creative Commons hash generation code. The RFC is easy enough to understand but there’s no substituting a good example. Or better yet, public domain code! I used this Java base32 encoder to write translate to a C# base32 encoder, which I’ve left as public domain.

    None Found
  • Chris
    Minor comment:
    current_byte = (data [i] >= 0) ? data [i] : (data [i] + 256); // Unsign

    isn't needed.

    In .net (unlike Java) bytes are unsigned values from 0-255. A byte will never be negative.
blog comments powered by Disqus