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>(); } } }
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 }); }
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]); }
void it_can_decrypt_from_a_hash_with_a_minimum_length() { var h = new Hashids(salt, 8); h.Decrypt("b9iLXiAa").Should().Equal(new [] { 1 }); }
void it_can_decrypt_from_a_hash_with_a_minimum_length() { var h = new Hashids(salt, 8); h.Decrypt("b9iLXiAa").Should().Equal(new [] {1}); }
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]); }