Java Hex Convert To fromHexChars(char[] chars, int i)

Here you can find the source of fromHexChars(char[] chars, int i)

Description

from Hex Chars

License

BSD License

Declaration

public static int fromHexChars(char[] chars, int i) 

Method Source Code

//package com.java2s;
//The contents of this file are subject to the "Simplified BSD License" (the "License");

public class Main {
    public static int fromHexChars(char[] chars, int i) {

        int n1 = chars[i] >= 'A' ? (10 + (chars[i] - 'A')) : (chars[i] - '0');
        i++;/*w  w w  . j av  a2 s . c om*/
        int n2 = chars[i] >= 'A' ? (10 + (chars[i] - 'A')) : (chars[i] - '0');
        byte b = (byte) ((n1 << 4) | n2);
        return b & 0xFF;

    }
}

Related

  1. fromHex2B(String src)
  2. fromHex8B(String src)
  3. fromHexa(String s)
  4. fromHexBinary(String s)
  5. fromHexChar(char ch)
  6. fromHexDigest(String hexDigest)
  7. fromHexDigit(final char c)
  8. fromHexDigit(int c)
  9. fromHexNibble(char n)