Exemple #1
0
 private async Task Add(KeyValuePair <string, int> word)
 {
     var salt          = _hashProvider.GenerateSalt();
     var hash          = _hashProvider.GenerateSHA256Hash(word.Key, salt);
     var encryptedWord = _encryptionProvier.Encrypt(word.Key.Trim().ToUpperFirstLetter());
     await _context.WordDictionary.AddAsync(new WordDictionary
     {
         Id    = hash.ToHexString(),
         Salt  = salt.ToHexString(),
         Word  = encryptedWord,
         Count = word.Value
     });
 }