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

GetHexString() static public method

static public GetHexString ( byte bytes ) : string
bytes byte
return string
		static public string GetHexString (byte [] bytes)
		{
			StringBuilder sb = new StringBuilder (bytes.Length * 2);
			int letterPart = 55;
			const int numberPart = 48;
			for (int i = 0; i < bytes.Length; i++) {
				int tmp = (int) bytes [i];
				int second = tmp & 15;
				int first = (tmp >> 4) & 15;
				sb.Append ((char) (first > 9 ? letterPart + first : numberPart + first));
				sb.Append ((char) (second > 9 ? letterPart + second : numberPart + second));
			}
			return sb.ToString ();
		}