Пример #1
0
        public void BytesToHex_Returns_Expected()
        {
            var input          = System.Text.Encoding.UTF8.GetBytes("Hello World");
            var expectedOutput = "48656c6c6f20576f726c64";

            var encoder      = new Encoder();
            var actualOutput = encoder.BytesToHex(input);

            Assert.AreEqual(expectedOutput, actualOutput);
        }
Пример #2
0
        public void Encode_With_Salt_Returns_Expected()
        {
            var key            = System.Text.Encoding.UTF8.GetBytes(Key);
            var input          = System.Text.Encoding.UTF8.GetBytes("ABCDEFGHIJKLMNOPQRSTUVWXYZXXSALTVALUEXX");
            var expectedOutput = "470000f77f36add3c3df434e34af2e745cdae05ebf43c75b0b94023f8c0b85c6e4521a7fa9f49e32bb0e3c32ab2a021f";
            var encoder        = new Encoder();
            var actualOutput   = encoder.BytesToHex(encoder.Encode(key, input));

            Assert.AreEqual(expectedOutput, actualOutput);
        }
Пример #3
0
        public void Encode_Returns_Expected()
        {
            var key            = System.Text.Encoding.UTF8.GetBytes(Key);
            var input          = System.Text.Encoding.UTF8.GetBytes("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
            var expectedOutput = "470000f77f36add3c3df434e34af2e74f09c40bc3f143b28762c7a045cb93b3c";

            var encoder      = new Encoder();
            var actualOutput = encoder.BytesToHex(encoder.Encode(key, input));

            Assert.AreEqual(expectedOutput, actualOutput);
        }