Provides the easy way to convert bytes to any string format in dotnet core. Many formats (Hex, Base32, Base58, Base64 and more) are already included out of the box. Backward conversion from string to bytes are supported as well.
This is not predicatable length encoding like Hex or Base64. It converts bytes to BigInteger and expresses the number in a base which matches alphabet length.
What this means to you is
- don't use it with bunch of bytes - it'll be slow,
- converting from string you should know the expected bytes length
Nothing fancy - install nuget package
Install-Package ByteEncodings
Look for inspiration in Test/Inspiration.cs, but in shortcut, use class:
- ByteEncoding - for bytes encodings to plenty string formats,
- Alphabet - if you need own alphabets / formats,
- BaseConverter - Integer arithmetic, number base convertion
Take a look in Test project for sample usage.
Thank you! I appreciate your contribution, bug reports, thougths, stars 👍
Questions ❓ - just fill an issue.
Translation by diavd from the Noun Project