tuweni / org.apache.tuweni.bytes / Bytes32

Bytes32

interface Bytes32 : Bytes (source)

A Bytes value that is guaranteed to contain exactly 32 bytes.

Properties

SIZE

The number of bytes in this value - i.e. 32

static val SIZE: Int

ZERO

A Bytes32 containing all zero bytes

static val ZERO: Bytes32!

Functions

and

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

open fun and(other: Bytes32!): Bytes32!

copy

abstract fun copy(): Bytes32!

fromHexString

Parse a hexadecimal string into a Bytes32.

open static fun fromHexString(str: CharSequence!): Bytes32!

fromHexStringLenient

Parse a hexadecimal string into a Bytes32.

open static fun fromHexStringLenient(str: CharSequence!): Bytes32!

fromHexStringStrict

Parse a hexadecimal string into a Bytes32.

open static fun fromHexStringStrict(str: CharSequence!): Bytes32!

leftPad

Left pad a Bytes value with a fill byte to create a Bytes32.

open static fun leftPad(value: Bytes!, fill: Byte): Bytes32!

Left pad a Bytes value with zero bytes to create a Bytes32.

open static fun leftPad(value: Bytes!): Bytes32!

mutableCopy

abstract fun mutableCopy(): MutableBytes32!

not

open fun not(): Bytes32!

or

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

open fun or(other: Bytes32!): Bytes32!

random

Generate random bytes.

open static fun random(): Bytes32!
open static fun random(generator: Random!): Bytes32!

rightPad

Right pad a Bytes value with zero bytes to create a Bytes32.

open static fun rightPad(value: Bytes!): Bytes32!

secure

Secures the provided byte array, which must be of length 32, as a Bytes32.

open static fun secure(bytes: ByteArray!): Bytes32!

Secures a slice/sub-part of the provided array as a Bytes32.

open static fun secure(bytes: ByteArray!, offset: Int): Bytes32!

shiftLeft

open fun shiftLeft(distance: Int): Bytes32!

shiftRight

open fun shiftRight(distance: Int): Bytes32!

size

open fun size(): Int

wrap

Wrap the provided byte array, which must be of length 32, as a Bytes32.

open static fun wrap(bytes: ByteArray!): Bytes32!

Wrap a slice/sub-part of the provided array as a Bytes32.

open static fun wrap(bytes: ByteArray!, offset: Int): Bytes32!

Wrap a the provided value, which must be of size 32, as a Bytes32.

open static fun wrap(value: Bytes!): Bytes32!

Wrap a slice/sub-part of the provided value as a Bytes32.

open static fun wrap(value: Bytes!, offset: Int): Bytes32!

xor

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

open fun xor(other: Bytes32!): Bytes32!

Inheritors

BytesUInt256Value

interface BytesUInt256Value<T : UInt256Value<T>!> : Bytes32, UInt256Value<T>

DelegatingBytes32

A class that holds and delegates all operations to its inner bytes field.

open class DelegatingBytes32 : DelegatingBytes, Bytes32

MutableBytes32

A mutable Bytes32, that is a mutable Bytes value of exactly 32 bytes.

interface MutableBytes32 : MutableBytes, Bytes32

UInt256Value

Represents a 256-bit (32 bytes) unsigned integer value.

interface UInt256Value<T : UInt256Value<T>!> : Bytes32