/// <summary> /// EncodeBase32 /// </summary> /// <param name="strDecode32"></param> /// <returns></returns> private string EncodeBase32(string strDecode32) { byte[] arrayEncode = new byte[1]; arrayEncode = System.Text.Encoding.ASCII.GetBytes(strDecode32); string strEncode32 = CBase32.Encode(arrayEncode); return(strEncode32); }
/// <summary> /// DecodeBase32 /// </summary> /// <param name="strEncode32"></param> /// <returns></returns> private string DecodeBase32(string strEncode32) { if (string.IsNullOrEmpty(strEncode32)) { return(string.Empty); } byte[] arrayDecode = new byte[1]; arrayDecode = CBase32.Decode(strEncode32); string strDecode32 = Convert.ToString(System.Text.Encoding.ASCII.GetString(arrayDecode)); strDecode32 = strDecode32.Replace("\0", string.Empty); return(strDecode32); }