Exemple #1
0
        public static bool Test()
        {
            bool       result     = true;
            Translator translator = new Translator();
            string     text       = Helpers.GetAllCharacters();

            translator.EncodeText(text);
            translator.DecodeBinary(translator.BinaryText);
            result &= translator.Text == text;
            translator.DecodeHex(translator.HexadecimalText);
            result &= translator.Text == text;
            //translator.DecodeASCII(translator.ASCIIText);
            //result &= translator.Text == text;
            translator.DecodeBase64(translator.Base64);
            result &= translator.Text == text;
            return(result);
        }
Exemple #2
0
 private void FillConversionInfo(string text)
 {
     if (translator != null)
     {
         if (!string.IsNullOrEmpty(text))
         {
             translator.EncodeText(text);
             txtHashCheckText.Text   = translator.Text;
             txtHashCheckBinary.Text = translator.BinaryText;
             txtHashCheckHex.Text    = translator.HexadecimalText;
             txtHashCheckASCII.Text  = translator.ASCIIText;
             txtHashCheckBase64.Text = translator.Base64;
             txtHashCheckHash.Text   = translator.HashToString();
         }
         else
         {
             translator.Clear();
             txtHashCheckText.Text = txtHashCheckBinary.Text = txtHashCheckHex.Text = txtHashCheckASCII.Text = txtHashCheckBase64.Text = txtHashCheckHash.Text = "";
         }
     }
 }
Exemple #3
0
 public static bool Test()
 {
     bool result = true;
     Translator translator = new Translator();
     string text = Helpers.GetAllCharacters();
     translator.EncodeText(text);
     translator.DecodeBinary(translator.BinaryText);
     result &= translator.Text == text;
     translator.DecodeHex(translator.HexadecimalText);
     result &= translator.Text == text;
     //translator.DecodeASCII(translator.ASCIIText);
     //result &= translator.Text == text;
     translator.DecodeBase64(translator.Base64);
     result &= translator.Text == text;
     return result;
 }