Here you can find the source of hexToBigInteger(String hex)
Parameter | Description |
---|---|
hex | to convert |
public static BigInteger hexToBigInteger(String hex)
//package com.java2s; //License from project: Apache License import java.math.BigInteger; public class Main { /**/*from www . j ava 2 s .com*/ * Convert hex to BigInteger. * * @param hex * to convert * @return biginteger from hex */ public static BigInteger hexToBigInteger(String hex) { if (hex == null) { return null; } if (hex.startsWith("0x")) { hex = hex.substring(2); } // remove starting zeros while (hex.length() > 1 && hex.charAt(0) == '0') { hex = hex.substring(1); } return new BigInteger(hex, 16); } }