public class

LargeIntHandler

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.primitives.LargeIntHandler

Class Overview

Handler for large integers of a given maximum bitsize. Those objects are created through a factory method.

Summary

Public Methods
BigInteger add(BigInteger a, BigInteger b)
BigInteger and(BigInteger a, BigInteger b)
BigInteger clearbit(BigInteger a, int n)
int compare(BigInteger a, BigInteger b)
int compareU(BigInteger a, BigInteger b)
static LargeIntHandler create(int bitsize)
BigInteger create(String val)
Create a new big integer.
BigInteger[] div2S(BigInteger a, BigInteger b)
BigInteger[] div2U(BigInteger a, BigInteger b)
BigInteger divS(BigInteger a, BigInteger b)
BigInteger divU(BigInteger a, BigInteger b)
int getBitsize()
BigInteger mul2S(BigInteger a, BigInteger b)
BigInteger mul2U(BigInteger a, BigInteger b)
BigInteger mulS(BigInteger a, BigInteger b)
BigInteger mulU(BigInteger a, BigInteger b)
BigInteger neg(BigInteger a)
BigInteger not(BigInteger a)
BigInteger or(BigInteger a, BigInteger b)
BigInteger remS(BigInteger a, BigInteger b)
BigInteger remU(BigInteger a, BigInteger b)
BigInteger rol(BigInteger a, int n)
BigInteger ror(BigInteger a, int n)
BigInteger sar(BigInteger a, int n)
shift with modulo-count (positive)
BigInteger setbit(BigInteger a, int n)
BigInteger shl(BigInteger a, int n)
shift with modulo-count (positive)
BigInteger shr(BigInteger a, int n)
shift with modulo-count (positive)
BigInteger sub(BigInteger a, BigInteger b)
boolean testbit(BigInteger a, int n)
BigInteger toUnsigned(BigInteger a)
Get the unsigned equivalent of the provided truncated integer.
String toUnsignedHexString(BigInteger v)
BigInteger truncate(BigInteger v)
Truncate and store as a signed value.
BigInteger truncate(String val)
Truncate and store as a signed value.
BigInteger xor(BigInteger a, BigInteger b)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public BigInteger add (BigInteger a, BigInteger b)

public BigInteger and (BigInteger a, BigInteger b)

public BigInteger clearbit (BigInteger a, int n)

public int compare (BigInteger a, BigInteger b)

public int compareU (BigInteger a, BigInteger b)

public static LargeIntHandler create (int bitsize)

public BigInteger create (String val)

Create a new big integer. The client is responsible for making sure that the two-complement representation of the value fits within bitsize bits.

public BigInteger[] div2S (BigInteger a, BigInteger b)

public BigInteger[] div2U (BigInteger a, BigInteger b)

public BigInteger divS (BigInteger a, BigInteger b)

public BigInteger divU (BigInteger a, BigInteger b)

public int getBitsize ()

public BigInteger mul2S (BigInteger a, BigInteger b)

public BigInteger mul2U (BigInteger a, BigInteger b)

public BigInteger mulS (BigInteger a, BigInteger b)

public BigInteger mulU (BigInteger a, BigInteger b)

public BigInteger neg (BigInteger a)

public BigInteger not (BigInteger a)

public BigInteger or (BigInteger a, BigInteger b)

public BigInteger remS (BigInteger a, BigInteger b)

public BigInteger remU (BigInteger a, BigInteger b)

public BigInteger rol (BigInteger a, int n)

public BigInteger ror (BigInteger a, int n)

public BigInteger sar (BigInteger a, int n)

shift with modulo-count (positive)

public BigInteger setbit (BigInteger a, int n)

public BigInteger shl (BigInteger a, int n)

shift with modulo-count (positive)

public BigInteger shr (BigInteger a, int n)

shift with modulo-count (positive)

public BigInteger sub (BigInteger a, BigInteger b)

public boolean testbit (BigInteger a, int n)

public BigInteger toUnsigned (BigInteger a)

Get the unsigned equivalent of the provided truncated integer.

Warning, this method is unsafe! The result may no longer be representable on bitsize bits.

public String toUnsignedHexString (BigInteger v)

public BigInteger truncate (BigInteger v)

Truncate and store as a signed value. The resulting integer 2-complement representation holds on at most bitsize bits.

public BigInteger truncate (String val)

Truncate and store as a signed value. The resulting integer 2-complement representation holds on at most bitsize bits.

Parameters
val string value (decimal, hex, or octal - with the right associated prefix or suffix)

public BigInteger xor (BigInteger a, BigInteger b)