HtmlParserSharp.Core.ElementName.BufToHash C# (CSharp) Method

BufToHash() private static method

This method has to return a unique integer for each well-known lower-cased element name.
private static BufToHash ( char buf, int len ) : int
buf char
len int
return int
		private static int BufToHash(char[] buf, int len)
		{
			int hash = len;
			hash <<= 5;
			hash += buf[0] - 0x60;
			int j = len;
			for (int i = 0; i < 4 && j > 0; i++)
			{
				j--;
				hash <<= 5;
				hash += buf[j] - 0x60;
			}
			return hash;
		}