System.HexConvert.ToUInt64 C# (CSharp) Method

ToUInt64() public static method

public static ToUInt64 ( string hexString, int offset ) : ulong
hexString string
offset int
return ulong
		public static ulong ToUInt64(string hexString, int offset)
		{
			const int maxLength = 16;

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

			var end = Math.Min(hexString.Length, offset + maxLength);
			var result = 0ul;
			for (var i = 0; offset < end; offset++, i++)
			{
				var hexChar = hexString[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(char[] hexBuffer, int offset)

Same methods

HexConvert::ToUInt64 ( char hexBuffer, int offset ) : ulong