示例#1
0
		/// <summary>
		/// Generates the activation key for a given email address.
		/// </summary>
		/// <param name="registrationName"></param>
		/// <returns></returns>
		protected string GenerateActivationKey(string registrationName)
		{
			Cryptographer crypto = new Cryptographer();
			string keyHash = crypto.Hash(registrationName + _APPLICATION_KEY);	
			
			System.Text.StringBuilder sb = new System.Text.StringBuilder(_ACTIVATION_KEY_LENGTH);
			foreach (char c in keyHash)
				sb.Append(_READABLE_HASH_CHARS[Convert.ToInt32((int)c / ((float)127 / (float)32))]);

			return sb.ToString();
		}
示例#2
0
		/// <summary>
		/// Gets the MD5 checksum for the passed WSDL, in hexadecimal format.
		/// </summary>
		/// <param name="wsdl">WSDL to generate checksum.</param>
		/// <returns>Checksum in hexadecimal format.</returns>
		public string GetWsdlChecksum(string wsdl)
		{
			Cryptographer crypto = new Cryptographer();
			return IOUtilities.ConvertToHex(crypto.Hash(wsdl));
		}