BgEngine.Infraestructure.Security.CodeFirstCrypto.BinaryToHex C# (CSharp) 메소드

BinaryToHex() 정적인 개인적인 메소드

static private BinaryToHex ( byte data ) : string
data byte
리턴 string
        internal static string BinaryToHex(byte[] data)
        {
            char[] hex = new char[data.Length * 2];

            for (int iter = 0; iter < data.Length; iter++)
            {
                byte hexChar = ((byte)(data[iter] >> 4));
                hex[iter * 2] = (char)(hexChar > 9 ? hexChar + 0x37 : hexChar + 0x30);
                hexChar = ((byte)(data[iter] & 0xF));
                hex[iter * 2 + 1] = (char)(hexChar > 9 ? hexChar + 0x37 : hexChar + 0x30);
            }
            return new string(hex);
        }