System.Web.Util.MachineKeySectionUtils.ToHexValue C# (CSharp) Method

ToHexValue() static private method

static private ToHexValue ( char c, bool high ) : byte
c char
high bool
return byte
		static byte ToHexValue (char c, bool high)
		{
			byte v;
			if (c >= '0' && c <= '9')
				v = (byte) (c - '0');
			else if (c >= 'a' && c <= 'f')
				v = (byte) (c - 'a' + 10);
			else if (c >= 'A' && c <= 'F')
				v = (byte) (c - 'A' + 10);
			else
				throw new ArgumentException ("Invalid hex character");

			if (high)
				v <<= 4;

			return v;
		}