Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/TextPublic

📚 Provides functions for encoding and decoding base 2, 8, 10, 16, 32, 64, 85 and 91 and more

License

NotificationsYou must be signed in to change notification settings

Roydl/Text

Repository files navigation

.NET CoreCross-platformLicense

Build+TestCommitsSource

NuGetNuGetWebsiteMirror

Roydl.Text

The idea was to create a comfortable way of binary-to-text encoding.

You can easily create instances of any type to translateStream,byte[] orstring data. Extension methods are also provided for all types.

Install:

$ dotnet add package Roydl.Text

Binary-To-Text Encoding

TypeEncoding
Base-2Binary character set:0 and1
Base-8Octal character set:0-7
Base-10Decimal character set:0-9
Base-16Hexadecimal character set:0-9 anda-f
Base-32Standard 32-character set:A–Z and2–7;= for padding
Base-64Standard 64-character set:A–Z,a–z,0–9,+ and/;= for padding
Base-85Standard 85-character set:!"#$%&'()*+,-./,0-9,:;<=>?@,A-Z,[]^_` anda-u
Base-91Standard 91-character set:A–Z,a–z,0–9, and!#$%&()*+,-.:;<=>?@[]^_`{|}~"

Usage:

// The `value` must be type `string` or `byte[]`, if `BinToTextEncoding` is// not set, `Base64` is used by default.stringbase85text=value.Encode(BinToTextEncoding.Base85);byte[]original=value.Decode(BinToTextEncoding.Base85);// if `value` to decode is `byte[]`stringoriginal=value.DecodeString(BinToTextEncoding.Base85);// if `value` to decode is `string`// The `value` of type `string` can also be a file path, which is not// recommended for large files, in this case you should create a// `Base85` instance and use `FileStream` to read and write.stringbase85text=value.EncodeFile(BinToTextEncoding.Base85);byte[]original=value.DecodeFile(BinToTextEncoding.Base85);

Would you like to help?

  • Star this Project ⭐ and show me that this project interests you 🤗
  • Open an Issue ☕ to give me your feedback and tell me your ideas and wishes for the future 😎
  • Open a Ticket 📫 if you don't have a GitHub account, you can contact me directly on my website 😉
  • Donate by PayPal 💸 to buy me some cakes 🍰

Please note that I cannot fix bugs that are unknown to me. So do yourself and me the favor and get in touch with me. 🤕


[8]ページ先頭

©2009-2025 Movatter.jp