From c14765a0f1f29f5f64223b30a3838c88e2267eea Mon Sep 17 00:00:00 2001 From: GoodBoyboy Date: Sat, 17 Feb 2024 14:56:36 +0800 Subject: [PATCH] =?UTF-8?q?[fix=20:]=E4=BC=98=E5=8C=96=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Form1.cs" | 41 ++++++++++++++++--- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git "a/\345\227\267\345\221\234\350\257\255\350\250\200\347\277\273\350\257\221\345\231\250/Form1.cs" "b/\345\227\267\345\221\234\350\257\255\350\250\200\347\277\273\350\257\221\345\231\250/Form1.cs" index e6a4a65..7ddb03e 100644 --- "a/\345\227\267\345\221\234\350\257\255\350\250\200\347\277\273\350\257\221\345\231\250/Form1.cs" +++ "b/\345\227\267\345\221\234\350\257\255\350\250\200\347\277\273\350\257\221\345\231\250/Form1.cs" @@ -28,6 +28,11 @@ private void translate_btn_Click(object sender, EventArgs e) } } #region ToAowu主逻辑 + /// + /// 地球语转换为嗷呜语 + /// + /// 文本内容 + /// private string Maintranslate(string text) { string translated_text = ""; @@ -46,8 +51,11 @@ private string Maintranslate(string text) } return translated_text; } - - private void Toeight(ref char[] chars)//向前补齐8位 + /// + /// 向前补齐8位 + /// + /// 需要补齐的字符 + private void Toeight(ref char[] chars) { while (chars.Length < 8) { @@ -59,7 +67,11 @@ private void Toeight(ref char[] chars)//向前补齐8位 chars[0] = '0'; } } - + /// + /// 转换主逻辑 + /// + /// 补齐八位后的字符 + /// private string Toaowu(char[] chars) { string aowu = ""; @@ -83,7 +95,12 @@ private string Toaowu(char[] chars) } return aowu; } - private string Quaternary(int str)//十进制转换为四进制 + /// + /// 十进制转换为四进制 + /// + /// 十进制Int + /// + private string Quaternary(int str) { string num = ""; while(str> 0) @@ -108,6 +125,11 @@ public static byte[] GetHash(string inputString) HashAlgorithm algorithm = SHA256.Create(); return algorithm.ComputeHash(Encoding.UTF8.GetBytes(inputString)); } + /// + /// 计算Hash + /// + /// 需要计算Hash的字符串 + /// public static string GetHashString(string inputString) { @@ -168,13 +190,22 @@ private void restore_btn_Click(object sender, EventArgs e) } } #region ToNormalLanguage主逻辑 + /// + /// 嗷呜语转换为地球语 + /// + /// 待转换的字符串(8位) + /// private string restore(string str) { return ((char)AowuTovDecimal(str)).ToString();//翻译为原文并返回 } - + /// + /// 嗷呜语转换为十进制数据 + /// + /// 嗷呜语(8位) + /// private int AowuTovDecimal(string str) { string ret = "";//待转换的四进制