Java Hex Calculate toHexDigit(int h)

Here you can find the source of toHexDigit(int h)

Description

to Hex Digit

License

Apache License

Declaration

private static char toHexDigit(int h) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static char toHexDigit(int h) {
        char out;
        if (h <= 9)
            out = (char) (h + 0x30);
        else//from  www  . j a  v a 2  s .  c  om
            out = (char) (h + 0x37);
        //System.err.println(h + ": " + out);
        return out;
    }
}

Related

  1. toHexDec(byte[] bytes)
  2. toHexDigit(char ch)
  3. toHexDigit(char ch, int index)
  4. toHexDigit(int d)
  5. toHexDigit(int d)
  6. toHexDigit(int i)
  7. toHexDigit(int number)
  8. toHexDigit(int value, int digitPosition)
  9. toHexDigits(byte[] bytes)