public void TestCustomAlphabetConversionOfZeroLengthArray()
        {
            var alphabet = "0123456789";

            var str = ConvertEx.ToCustomAlphabetString(new byte[0], alphabet);

            str.ShouldBe("");

            var decoded = ConvertEx.FromCustomAlphabetStringToBytes(str, alphabet);

            decoded.ShouldBe(new byte[0]);
        }
        public void TestCustomAlphabetConversionOfArrayOfZeros()
        {
            var alphabet = "01";
            var bytes    = new byte[7];

            var str = ConvertEx.ToCustomAlphabetString(bytes, alphabet);

            str.ShouldBe("0000000");

            var decoded = ConvertEx.FromCustomAlphabetStringToBytes(str, alphabet);

            decoded.ShouldBe(bytes);
        }
        public void TestCustomAlphabetConversionOfArrayWithTrailingZeros()
        {
            var alphabet = "01";
            var bytes    = new byte[] { 5, 3, 0 };

            var str = ConvertEx.ToCustomAlphabetString(bytes, alphabet);

            str.ShouldBe("01100000101");

            var decoded = ConvertEx.FromCustomAlphabetStringToBytes(str, alphabet);

            decoded.ShouldBe(bytes);

            var bytesBigEndian = new byte[] { 0, 3, 5 };

            var strBigEndian = ConvertEx.ToCustomAlphabetString(bytesBigEndian, alphabet, isBigEndian: true);

            strBigEndian.ShouldBe("01100000101");

            var decodedBigEndian = ConvertEx.FromCustomAlphabetStringToBytes(strBigEndian, alphabet, isBigEndian: true);

            decodedBigEndian.ShouldBe(bytesBigEndian);
        }