Java BigInteger From toBigIntegerFromHex(String val)

Here you can find the source of toBigIntegerFromHex(String val)

Description

Parses 0x representation of the BigInteger from string

License

Open Source License

Parameter

Parameter Description
val string to parse

Return

parsed

Declaration

public static BigInteger toBigIntegerFromHex(String val) 

Method Source Code


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

import java.math.BigInteger;

public class Main {
    /**//from  w  w  w  .j a va2s  . c o m
     * Parses 0x representation of the {@link BigInteger} from string
     * @param val string to parse
     * @return parsed
     */
    public static BigInteger toBigIntegerFromHex(String val) {
        BigInteger n = new BigInteger(val.replace("0x", ""), 16);
        return n;
    }
}

Related

  1. getUnsignedBigInteger(long x)
  2. string2BigInteger(String plaintext)
  3. toBigInteger(@Nullable final Boolean value, @Nullable final BigInteger defaultValue)
  4. toBigInteger(@Nullable final byte[] value)
  5. ToBigInteger(BitSet bs)