Esempio n. 1
0
        public void it_encrypts_and_decrypts_lists_of_large_numbers()
        {
            var input = new List <long>();

            for (long i = 1000000000L, j = 1; i < 1000001000L; i++, j++)
            {
                input.Add(i);
                if (j % 5 == 0)
                {
                    Assert.AreEqual(input, hashids.Decrypt(hashids.Encrypt(input.ToArray())));
                    input = new List <long>();
                }
            }
        }
Esempio n. 2
0
 void it_decrypts_an_ecrypted_number()
 {
     hashids.Decrypt("ryBo").Should().Equal(new [] { 12345 });
     hashids.Decrypt("qkpA").Should().Equal(new [] { 1337 });
     hashids.Decrypt("6aX").Should().Equal(new [] { 808 });
     hashids.Decrypt("gz9").Should().Equal(new [] { 303 });
 }
Esempio n. 3
0
        void it_does_not_decrypt_with_a_different_salt()
        {
            var peppers = new Hashids("this is my pepper");

            hashids.Decrypt("ryBo").Should().Equal(new [] { 12345 });
            peppers.Decrypt("ryBo").Should().Equal(new int [0]);
        }
Esempio n. 4
0
        void it_can_decrypt_from_a_hash_with_a_minimum_length()
        {
            var h = new Hashids(salt, 8);

            h.Decrypt("b9iLXiAa").Should().Equal(new [] { 1 });
        }
Esempio n. 5
0
		void it_can_decrypt_from_a_hash_with_a_minimum_length()
		{
			var h = new Hashids(salt, 8);
			h.Decrypt("b9iLXiAa").Should().Equal(new [] {1});
		}
Esempio n. 6
0
		void it_does_not_decrypt_with_a_different_salt()
		{
			var peppers = new Hashids("this is my pepper");
			hashids.Decrypt("ryBo").Should().Equal(new []{ 12345 });
			peppers.Decrypt("ryBo").Should().Equal(new int [0]);
		}