MD4

Class in ChivalrousGames.Common / Inherits from HashAlgorithm

Description

MD4, hash algorithm to calculate Unity Type hash.

Usage Example

string toBeHashed = "s\0\0\0" + t.Namespace + t.Name;
using (HashAlgorithm hash = new MD4())
{
	byte[] hashed = hash.ComputeHash(Encoding.UTF8.GetBytes(toBeHashed));

	int result = 0;

	for(int i = 3; i >= 0; --i)
	{
		result <<= 8;
		result |= hashed[i];
		}

	return result;
}

Constructors

Constructor
public MD4();
Return
MD4 Instance of MD4 hash algorithm
Description

Creates a new instance of the MD4 hash algorithm. Should always be used in a using statement. (see Class usage exmaple)

Usage Example

See Class usage example

Methods

Initialize
public override void Initialize();
Description

Initializes the hash algorithm. Do not call this manually, constructor already does it.
Override of the Initialize method of HashAlgorithm class.