Пример #1
0
 public void Strike(TokenPlanchet planchet)
 {
     using (var fiveByFive = Generate5x5UsingFakeAlgorithm())
     {
         planchet.Id   = generator.Next();
         planchet.Code = security.EncryptAsBase64(fiveByFive, salt);
         planchet.Hash = security.HashAsBase64(fiveByFive);
     }
 }
Пример #2
0
 string HashFiveByFiveWithoutFormatting(string fiveByFive)
 {
     using (var tokenCode = new System.Security.SecureString())
     {
         fiveByFive.Replace("-", string.Empty).ForEach(tokenCode.AppendChar);
         tokenCode.MakeReadOnly();
         return(tokenSecurity.HashAsBase64(tokenCode));
     }
 }