Apache.Shiro.Codec.Hex.ToHexString C# (CSharp) Method

ToHexString() public static method

public static ToHexString ( byte bytes ) : string
bytes byte
return string
        public static string ToHexString(byte[] bytes)
        {
            if (bytes == null)
            {
                throw new ArgumentNullException("bytes");
            }
            int length = bytes.Length;

            StringBuilder buffer = new StringBuilder(length * 2);
            foreach (byte b in bytes)
            {
                buffer.Append(b.ToString("X2"));
            }

            return buffer.ToString();
        }