public class DataWord extends Object implements Comparable<DataWord>
Modifier and Type | Field and Description |
---|---|
static BigInteger |
_2_256 |
static BigInteger |
MAX_VALUE |
static DataWord |
ZERO |
static DataWord |
ZERO_EMPTY_ARRAY |
Constructor and Description |
---|
DataWord() |
DataWord(byte[] data) |
DataWord(ByteArrayWrapper wrappedData) |
DataWord(int num) |
DataWord(long num) |
DataWord(String data) |
Modifier and Type | Method and Description |
---|---|
void |
add(DataWord word) |
void |
add2(DataWord word) |
void |
addmod(DataWord word1,
DataWord word2) |
DataWord |
and(DataWord w2) |
String |
asString() |
String |
bigIntValue() |
void |
bnot() |
int |
bytesOccupied() |
DataWord |
clone() |
int |
compareTo(DataWord o) |
void |
div(DataWord word) |
boolean |
equals(Object o) |
void |
exp(DataWord word) |
byte[] |
getData() |
byte[] |
getLast20Bytes() |
byte[] |
getNoLeadZeroesData() |
int |
hashCode() |
int |
intValue()
Converts this DataWord to an int, checking for lost information.
|
int |
intValueSafe()
In case of int overflow returns Integer.MAX_VALUE
otherwise works as #intValue()
|
boolean |
isHex(String hex) |
boolean |
isNegative() |
boolean |
isZero() |
long |
longValue()
Converts this DataWord to a long, checking for lost information.
|
long |
longValueSafe()
In case of long overflow returns Long.MAX_VALUE
otherwise works as #longValue()
|
void |
mod(DataWord word) |
void |
mul(DataWord word) |
void |
mulmod(DataWord word1,
DataWord word2) |
void |
negate() |
DataWord |
or(DataWord w2) |
void |
sDiv(DataWord word) |
String |
shortHex() |
void |
signExtend(byte k) |
void |
sMod(DataWord word) |
void |
sub(DataWord word) |
BigInteger |
sValue() |
String |
toHexString() |
String |
toPrefixString() |
String |
toString() |
BigInteger |
value() |
DataWord |
xor(DataWord w2) |
public static final BigInteger _2_256
public static final BigInteger MAX_VALUE
public static final DataWord ZERO
public static final DataWord ZERO_EMPTY_ARRAY
public DataWord()
public DataWord(int num)
public DataWord(long num)
public DataWord(String data)
public DataWord(ByteArrayWrapper wrappedData)
public DataWord(byte[] data)
public byte[] getData()
public byte[] getNoLeadZeroesData()
public byte[] getLast20Bytes()
public BigInteger value()
public int intValue()
ArithmeticException
- - if this will not fit in an int.public int intValueSafe()
public long longValue()
ArithmeticException
- - if this will not fit in a long.public long longValueSafe()
public BigInteger sValue()
public String bigIntValue()
public boolean isZero()
public boolean isNegative()
public void negate()
public void bnot()
public void add(DataWord word)
public void add2(DataWord word)
public void mul(DataWord word)
public void div(DataWord word)
public void sDiv(DataWord word)
public void sub(DataWord word)
public void exp(DataWord word)
public void mod(DataWord word)
public void sMod(DataWord word)
public String toPrefixString()
public String shortHex()
public int compareTo(DataWord o)
compareTo
in interface Comparable<DataWord>
public void signExtend(byte k)
public int bytesOccupied()
public boolean isHex(String hex)
public String asString()
public String toHexString()
Copyright © 2020. All rights reserved.