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