Java Hex to Byte convertHexDigit(byte b)

Here you can find the source of convertHexDigit(byte b)

Description

convert Hex Digit

License

Open Source License

Declaration

private static byte convertHexDigit(byte b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static byte convertHexDigit(byte b) {
        if ((b >= '0') && (b <= '9')) {
            return (byte) (b - '0');
        }/*www.j  ava  2s  .  com*/
        if ((b >= 'a') && (b <= 'f')) {
            return (byte) (b - 'a' + 10);
        }
        if ((b >= 'A') && (b <= 'F')) {
            return (byte) (b - 'A' + 10);
        }
        return 0;
    }
}

Related

  1. convertHexCharacterToHalfByte(char character)
  2. convertHexDigit(byte b)
  3. convertHexDigit(byte b)
  4. convertHexDigit(byte b)
  5. convertHexDigit(byte c)