@tevm/voltaire / index / BrandedBytes16
BrandedBytes16
Type Aliases
Bytes16Like
Bytes16Like =Defined in: src/primitives/Bytes/Bytes16/Bytes16Type.ts:11 Inputs that can be converted to Bytes16Bytes16Type|string|Uint8Array
Variables
SIZE
Defined in: src/primitives/Bytes/Bytes16/Bytes16Type.ts:13constSIZE:16=16
ZERO
Defined in: src/primitives/Bytes/Bytes16/constants.js:10 Zero Bytes16 constant (16 zero bytes)constZERO:Bytes16Type
Functions
Bytes16()
Bytes16(Defined in: src/primitives/Bytes/Bytes16/index.ts:39value):Bytes16Type
Parameters
value
Bytes16Like
Returns
Bytes16Type
clone()
clone(Defined in: src/primitives/Bytes/Bytes16/clone.js:14 Clone a Bytes16 valuebytes):Bytes16Type
Parameters
bytes
Bytes16Type
Value to clone
Returns
Bytes16Type
Cloned value
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Example
compare()
compare(Defined in: src/primitives/Bytes/Bytes16/compare.js:15 Compare two Bytes16 valuesa,b):number
Parameters
a
Bytes16Type
First value
b
Bytes16Type
Second value
Returns
number
-1 if a < b, 0 if equal, 1 if a > b
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Example
equals()
equals(Defined in: src/primitives/Bytes/Bytes16/equals.js:15 Check if two Bytes16 values are equala,b):boolean
Parameters
a
Bytes16Type
First value
b
Bytes16Type
Second value
Returns
boolean
True if equal
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Example
from()
from(Defined in: src/primitives/Bytes/Bytes16/from.js:19 Create Bytes16 from string or bytesvalue):Bytes16Type
Parameters
value
Hex string with optional 0x prefix or Uint8Arraystring | Uint8Array<ArrayBufferLike>
Returns
Bytes16Type
Bytes16
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Throws
If input is invalid or wrong lengthExample
fromBytes()
fromBytes(Defined in: src/primitives/Bytes/Bytes16/fromBytes.js:18 Create Bytes16 from raw bytesbytes):Bytes16Type
Parameters
bytes
Uint8Array<ArrayBufferLike>
Raw bytes (must be 16 bytes)
Returns
Bytes16Type
Bytes16
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Throws
If bytes is wrong lengthExample
fromHex()
fromHex(Defined in: src/primitives/Bytes/Bytes16/fromHex.js:19 Create Bytes16 from hex stringhex):Bytes16Type
Parameters
hex
string
Hex string with optional 0x prefix
Returns
Bytes16Type
Bytes16
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Throws
If hex is wrong lengthThrows
If hex contains invalid charactersExample
isZero()
isZero(Defined in: src/primitives/Bytes/Bytes16/isZero.js:14 Check if Bytes16 is all zerosbytes):boolean
Parameters
bytes
Bytes16Type
Value to check
Returns
boolean
True if all zeros
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Example
size()
size(Defined in: src/primitives/Bytes/Bytes16/size.js:16 Get size of Bytes16 (always 16)_bytes):16
Parameters
_bytes
Bytes16Type
Bytes16 value
Returns
16
Size in bytes
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Example
toHex()
toHex(Defined in: src/primitives/Bytes/Bytes16/toHex.js:15 Convert Bytes16 to hex stringbytes):string
Parameters
bytes
Bytes16Type
Bytes16 to convert
Returns
string
Hex string with 0x prefix
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Example
toUint8Array()
toUint8Array(Defined in: src/primitives/Bytes/Bytes16/toUint8Array.js:14 Convert Bytes16 to Uint8Arraybytes):Uint8Array<ArrayBufferLike>
Parameters
bytes
Bytes16Type
Bytes16 to convert
Returns
Uint8Array<ArrayBufferLike>
Raw bytes
See
https://voltaire.tevm.sh/primitives/bytes/bytes16 for documentationSince
0.0.0Example
zero()
zero(): Bytes16Type
Defined in: src/primitives/Bytes/Bytes16/zero.js:15
Create a zero-filled Bytes16
Returns
Bytes16Type
Zero-filled Bytes16

