示例#1
0
        void issue_14_it_should_decode_encode_hex_correctly()
        {
            var hashids = new Hashids("this is my salt");
            var encoded = hashids.EncodeHex("DEADBEEF");

            encoded.Should().Be("kRNrpKlJ");

            var decoded = hashids.DecodeHex(encoded);

            decoded.Should().Be("DEADBEEF");

            var encoded2 = hashids.EncodeHex("1234567890ABCDEF");
            var decoded2 = hashids.DecodeHex(encoded2);

            decoded2.Should().Be("1234567890ABCDEF");
        }
示例#2
0
 void it_decode_an_encoded_number()
 {
     hashids.DecodeHex("lzY").Should().Be("FA");
     hashids.DecodeHex("eBMrb").Should().Be("FF1A");
     hashids.DecodeHex("D9NPE").Should().Be("12ABC");
 }