Guest User

Untitled

a guest
Jan 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. byte[] bytes = Encoding.Unicode.GetBytes(text);
  2. byte[] hash;
  3.  
  4. MemoryStream stream = new MemoryStream();
  5. stream.WriteByte(0);
  6.  
  7. var cripto1 = new CriptoProvider1();
  8. hash = cripto1.ComputeHash(bytes);
  9.  
  10. stream.Write(hash, 0, hash.Length);
  11. stream.WriteByte(0);
  12.  
  13. var cripto2 = new CriptoProvider2();
  14. hash = cripto2.ComputeHash(bytes);
  15.  
  16. stream.Write(hash, 0, hash.Length);
  17.  
  18.  
  19. bytes = stream.ToArray();
  20. string result = Convert.ToBase64String(bytes);
  21.  
  22. return result;
Add Comment
Please, Sign In to add comment