tuweni / org.apache.tuweni.units.bigints / UInt32

UInt32

class UInt32 : UInt32Value<UInt32> (source)

An unsigned 32-bit precision number. This is a raw UInt32Value - a 32-bit precision unsigned number of no particular unit.

Properties

MAX_VALUE

static val MAX_VALUE: UInt32

The maximum value of a UInt32

MIN_VALUE

static val MIN_VALUE: UInt32

The minimum value of a UInt32

ONE

static val ONE: UInt32

The value 1

ZERO

static val ZERO: UInt32

The value 0

Functions

add

fun add(value: UInt32): UInt32
fun add(value: Int): UInt32

addMod

fun addMod(value: UInt32, modulus: UInt32): UInt32
fun addMod(value: Long, modulus: UInt32): UInt32
fun addMod(value: Long, modulus: Long): UInt32

and

fun and(value: UInt32): UInt32

Return a bit-wise AND of this value and the supplied value.

fun and(bytes: Bytes): UInt32

Return a bit-wise AND of this value and the supplied bytes.

bitLength

fun bitLength(): Int

compareTo

fun compareTo(other: UInt32): Int

divide

fun divide(value: UInt32): UInt32
fun divide(value: Int): UInt32

equals

fun equals(other: Any?): Boolean

fromBytes

static fun fromBytes(bytes: Bytes): UInt32

Return a UInt32 containing the value described by the specified bytes.

fromHexString

static fun fromHexString(str: String): UInt32

Parse a hexadecimal string into a UInt32.

hashCode

fun hashCode(): Int

intValue

fun intValue(): Int

isZero

fun isZero(): Boolean

mod

fun mod(modulus: UInt32): UInt32
fun mod(modulus: Int): UInt32

multiply

fun multiply(value: UInt32): UInt32
fun multiply(value: Int): UInt32

multiplyMod

fun multiplyMod(value: UInt32, modulus: UInt32): UInt32
fun multiplyMod(value: Int, modulus: UInt32): UInt32
fun multiplyMod(value: Int, modulus: Int): UInt32

not

fun not(): UInt32

Return a bit-wise NOT of this value.

numberOfLeadingZeros

fun numberOfLeadingZeros(): Int

or

fun or(value: UInt32): UInt32

Return a bit-wise OR of this value and the supplied value.

fun or(bytes: Bytes): UInt32

Return a bit-wise OR of this value and the supplied bytes.

pow

fun pow(exponent: UInt32): UInt32
fun pow(exponent: Long): UInt32

shiftLeft

fun shiftLeft(distance: Int): UInt32

Shift all bits in this value to the left.

shiftRight

fun shiftRight(distance: Int): UInt32

Shift all bits in this value to the right.

subtract

fun subtract(value: UInt32): UInt32
fun subtract(value: Int): UInt32

toBigInteger

fun toBigInteger(): BigInteger

toBytes

fun toBytes(): Bytes

toLong

fun toLong(): Long

toMinimalBytes

fun toMinimalBytes(): Bytes

toString

fun toString(): String

toUInt32

fun toUInt32(): UInt32

valueOf

static fun valueOf(value: Int): UInt32

Return a UInt32 containing the specified value.

static fun valueOf(value: BigInteger): UInt32

Return a UInt32 containing the specified value.

xor

fun xor(value: UInt32): UInt32

Return a bit-wise XOR of this value and the supplied value. If this value and the supplied value are different lengths, then the shorter will be zero-padded to the left.

fun xor(bytes: Bytes): UInt32

Return a bit-wise XOR of this value and the supplied bytes.

Inherited Functions

addExact

open fun addExact(value: T): T
open fun addExact(value: Int): T

Returns a value that is (this + value).

fitsInt

open fun fitsInt(): Boolean

fitsLong

open fun fitsLong(): Boolean

subtractExact

open fun subtractExact(value: T): T
open fun subtractExact(value: Int): T

Returns a value that is (this - value).

toHexString

open fun toHexString(): String

This value represented as an hexadecimal string.

Note that this representation includes all the 8 underlying bytes, no matter what the integer actually represents (in other words, it can have many leading zeros). For a shorter representation that don't include leading zeros, use #toShortHexString.

toShortHexString

open fun toShortHexString(): String