Base32 Decoding

后端 未结 7 616
遥遥无期
遥遥无期 2020-11-27 15:52

I have a base32 string which I need to convert to a byte array. And I\'m having trouble finding a conversion method in the .NET framework. I can find methods for base64 but

相关标签:
7条回答
  • 2020-11-27 16:30

    This is a really old question, but I happened to stumble on it wanting the same thing for OTP tokens. It turns out that there is base 32 functionality built into the OTP.NET package on NuGet:

    Base32Encoding.ToBytes("(your base 32 string here)")
    

    The reverse is also possible:

    Base32Encoding.ToString(new byte[] { /* your bytes here */ })
    
    0 讨论(0)
提交回复
热议问题