Java Hex Calculate ToHexNumber(int c)

Here you can find the source of ToHexNumber(int c)

Description

To Hex Number

License

Creative Commons License

Declaration

private static int ToHexNumber(int c) 

Method Source Code

//package com.java2s;

public class Main {
    private static int ToHexNumber(int c) {
        if (c >= 'A' && c <= 'Z')
            return 10 + c - 'A';
        else if (c >= 'a' && c <= 'z')
            return 10 + c - 'a';
        else if (c >= '0' && c <= '9')
            return c - '0';
        return -1;
    }/*from   w w  w  .  j  a  v a  2 s  .c  o m*/
}

Related

  1. toHexFromBytes(final byte[] bytes)
  2. toHexFromOct(final String octSymbols)
  3. toHexHashString(byte[] id)
  4. toHexLiteral(int v)
  5. toHexN(long src, int hexn)
  6. toHexOrNegative(int i)
  7. toHexPadZero(byte[] bytes)
  8. toHexShortString(byte[] bytes)
  9. toHexStr(byte b[])