示例#1
0
		public static ID GenerateID(IKey key)
		{
			byte[] keyBytes = key.GetBytes();
			ID id;
			using (SHA1 sha1 = new SHA1CryptoServiceProvider())
			{
				id = new ID(sha1.ComputeHash(keyBytes));
				sha1.Clear();
			}
			return id;
		}