<tfoot id='aIXXO'></tfoot>
    <legend id='aIXXO'><style id='aIXXO'><dir id='aIXXO'><q id='aIXXO'></q></dir></style></legend>

      <small id='aIXXO'></small><noframes id='aIXXO'>

      1. <i id='aIXXO'><tr id='aIXXO'><dt id='aIXXO'><q id='aIXXO'><span id='aIXXO'><b id='aIXXO'><form id='aIXXO'><ins id='aIXXO'></ins><ul id='aIXXO'></ul><sub id='aIXXO'></sub></form><legend id='aIXXO'></legend><bdo id='aIXXO'><pre id='aIXXO'><center id='aIXXO'></center></pre></bdo></b><th id='aIXXO'></th></span></q></dt></tr></i><div id='aIXXO'><tfoot id='aIXXO'></tfoot><dl id='aIXXO'><fieldset id='aIXXO'></fieldset></dl></div>

          <bdo id='aIXXO'></bdo><ul id='aIXXO'></ul>

        将字符串转换为 BASE62

        Convert a string into BASE62(将字符串转换为 BASE62)

            <tbody id='ncs8W'></tbody>
        1. <legend id='ncs8W'><style id='ncs8W'><dir id='ncs8W'><q id='ncs8W'></q></dir></style></legend>
            <bdo id='ncs8W'></bdo><ul id='ncs8W'></ul>

          • <tfoot id='ncs8W'></tfoot>

              • <small id='ncs8W'></small><noframes id='ncs8W'>

                <i id='ncs8W'><tr id='ncs8W'><dt id='ncs8W'><q id='ncs8W'><span id='ncs8W'><b id='ncs8W'><form id='ncs8W'><ins id='ncs8W'></ins><ul id='ncs8W'></ul><sub id='ncs8W'></sub></form><legend id='ncs8W'></legend><bdo id='ncs8W'><pre id='ncs8W'><center id='ncs8W'></center></pre></bdo></b><th id='ncs8W'></th></span></q></dt></tr></i><div id='ncs8W'><tfoot id='ncs8W'></tfoot><dl id='ncs8W'><fieldset id='ncs8W'></fieldset></dl></div>

                1. 本文介绍了将字符串转换为 BASE62的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在寻找将字符串转换为 BASE62 的 c# 代码,如下所示:

                  http://www.molengo.com/base62/title/base62-encoder-decoder

                  我需要那些用于 URL 编码的编码和解码方法.

                  解决方案

                  BINARY to TEXT 编码方案的背景:

                  https://en.wikipedia.org/wiki/Base62

                  https://en.wikipedia.org/wiki/Base64

                  BASE62编码方案的好解释:

                  https://www.codeproject.com/Articles/1076295/Base-Encode

                  试试这里提供的 C# 库,它添加了一些扩展方法,允许您将字节数组与 BASE62(二进制到文本编码方案)相互转换.

                  github上有很多base62库,看看:

                  • https://github.com/JoyMoe/Base62.Net
                  • https://github.com/ghost1face/base62
                  • https://github.com/rossdempster/base62csharp
                  • https://github.com/renmengye/base62-csharp(以下声明它不起作用...向他们提出任何问题)

                  如果您的源数据包含在字符串"中,则那么你首先需要转换你的字符串".到一个合适的字节数组.

                  但要小心,使用正确的字符串到字节转换调用......因为您可能希望字节是 ASCII 字符或 Unicode 字节流等,即 Encoding.GetBytes(text)System.Text.ASCIIEncoding.ASCII.GetBytes(text);

                  <块引用>

                  byte[] bytestoencode = .....string encodingasBASE62 = bytestoencode.ToBase62();......byte[] bytesdecoded = encodeasBASE62.FromBase62();

                  I'm looking for the c# code to convert a string into BASE62, like this:

                  http://www.molengo.com/base62/title/base62-encoder-decoder

                  I need those encode and decode-methods for URL-Encoding.

                  解决方案

                  Background on BINARY to TEXT Encoding schemes:

                  https://en.wikipedia.org/wiki/Base62

                  https://en.wikipedia.org/wiki/Base64

                  Good explanation of the BASE62 encoding scheme:

                  https://www.codeproject.com/Articles/1076295/Base-Encode

                  Try the C# libraries available here which adds some extension methods to allow you to convert a byte array to and from BASE62 (binary-to-text encoding schemes).

                  Plenty of base62 libraries on github, have a look:

                  • https://github.com/JoyMoe/Base62.Net
                  • https://github.com/ghost1face/base62
                  • https://github.com/rossdempster/base62csharp
                  • https://github.com/renmengye/base62-csharp (claims below that it doesn't work...raise any issues with them)

                  If your source data is contained in a "string" then you would first need to convert your "string" to a suitable byte array.

                  But be careful, to use the correct string to byte conversion call....as you may want the bytes to be the ASCII characters, or the Unicode byte stream etc i.e. Encoding.GetBytes(text) or System.Text.ASCIIEncoding.ASCII.GetBytes(text);, etc

                  byte[] bytestoencode = ..... 
                  
                  string encodedasBASE62 = bytestoencode.ToBase62();
                  
                  .....
                  
                  byte[] bytesdecoded = encodedasBASE62.FromBase62();
                  

                  这篇关于将字符串转换为 BASE62的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to keep the Text of a Read only TextBox after PostBack()?(PostBack()之后如何保留只读文本框的文本?)
                  Winforms Textbox - Using Ctrl-Backspace to Delete Whole Word(Winforms 文本框 - 使用 Ctrl-Backspace 删除整个单词)
                  C# - Add button click events using code(C# - 使用代码添加按钮单击事件)
                  Multi-color TextBox C#(多色文本框 C#)
                  How can i set the caret position to a specific index in passwordbox in WPF(如何将插入符号位置设置为 WPF 密码框中的特定索引)
                  C# Numeric Only TextBox Control(C# 纯数字文本框控件)
                  <i id='B42lv'><tr id='B42lv'><dt id='B42lv'><q id='B42lv'><span id='B42lv'><b id='B42lv'><form id='B42lv'><ins id='B42lv'></ins><ul id='B42lv'></ul><sub id='B42lv'></sub></form><legend id='B42lv'></legend><bdo id='B42lv'><pre id='B42lv'><center id='B42lv'></center></pre></bdo></b><th id='B42lv'></th></span></q></dt></tr></i><div id='B42lv'><tfoot id='B42lv'></tfoot><dl id='B42lv'><fieldset id='B42lv'></fieldset></dl></div>
                    • <bdo id='B42lv'></bdo><ul id='B42lv'></ul>
                          <tbody id='B42lv'></tbody>
                        <legend id='B42lv'><style id='B42lv'><dir id='B42lv'><q id='B42lv'></q></dir></style></legend>

                        <small id='B42lv'></small><noframes id='B42lv'>

                        <tfoot id='B42lv'></tfoot>