private static char IntToHex(int n) { if (n <= 9) return (char)(n + (int)'0'); else return (char)(n - 10 + (int)'a'); }