Documentation Index
Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
Use this file to discover all available pages before exploring further.
Combine multiple hex strings into a single hex value
import { Bytes } from '@tevm/voltaire/Bytes';
import * as Hex from '@tevm/voltaire/Hex';
// Create some hex strings
const hex1 = Hex.from("0x1234");
const hex2 = Hex.from("0x5678");
const hex3 = Hex.from("0xabcd");
// Concatenate them (variadic arguments)
const combined = Hex.concat(hex1, hex2, hex3);
// Can also concatenate with bytes converted to hex
const bytes = Bytes.from([0x01, 0x02, 0x03]);
const hexFromBytes = Hex.fromBytes(bytes);
const withBytes = Hex.concat(hex1, hexFromBytes);
// Concatenate just two
const twoValues = Hex.concat("0xaa", "0xbb");