System.HexConvert.ToUInt32 C# (CSharp) Method

ToUInt32() public static method

public static ToUInt32 ( char hexBuffer, int offset ) : uint
hexBuffer char
offset int
return uint
		public static uint ToUInt32(char[] hexBuffer, int offset)
		{
			const int maxLength = 8;

			if (hexBuffer == null) throw new ArgumentNullException("hexBuffer");
			if (offset < 0) throw new ArgumentOutOfRangeException("offset");
			if (offset + 1 > hexBuffer.Length) throw new ArgumentOutOfRangeException("offset");

			var end = Math.Min(hexBuffer.Length, offset + maxLength);
			var result = 0u;
			for (var i = 0; offset < end; offset++, i++)
			{
				var hexChar = hexBuffer[offset];
				var hexNum = ToHexNum(hexChar);

				if (i % 2 == 1)
					result |= hexNum << (i - 1) * 4;
				else
					result |= hexNum << (i + 1) * 4;
			}

			return result;
		}
		public static uint ToUInt32(string hexString, int offset)

Same methods

HexConvert::ToUInt32 ( string hexString, int offset ) : uint