示例#1
0
        public void IntEncode()
        {
            var encoder = new IntEncoder();
            var bytes   = encoder.Encode(1);

            bytes.IsCollection <byte>(0x01, 0x00, 0x00, 0x00);
            encoder.Decode(bytes).Is(1);
        }
示例#2
0
        public void CombinedEncode()
        {
            var intEncoder      = new IntEncoder();
            var aesEncoder      = new AesEncoder("password", "salt-1234567890");
            var combinedEncoder = new CombinedEncoder <int>(intEncoder, aesEncoder);
            var combinedBytes   = combinedEncoder.Encode(1);

            var aesDecode = aesEncoder.Decode(combinedBytes);
            var intDecode = intEncoder.Decode(aesDecode);

            intDecode.Is(1);
        }