Advertisement
Guest User

SHA1

a guest
Aug 13th, 2011
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class SHA1 : MonoBehaviour
  5. {
  6.  
  7.     // Use this for initialization
  8.     void Start()
  9.     {
  10.         var input = "cheese";
  11.         var result = "";
  12.  
  13.         System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
  14.         byte[] bytes = encoding.GetBytes(input);
  15.  
  16.         var sha = new System.Security.Cryptography.SHA1CryptoServiceProvider();
  17.         // This is one implementation of the abstract class SHA1.
  18.         result = System.BitConverter.ToString(sha.ComputeHash(bytes));
  19.  
  20.         print(result);
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement