Fixed 32-byte value wrapper
import Voltaire
let b = try Bytes32(hex: "0x" + String(repeating: "00", count: 32))
print(b.hex)
XCTAssertEqual(b.bytes.count, 32)
let b2 = try Bytes32(bytes: b.bytes)
XCTAssertEqual(b, b2)
// Zero constant
let zero = Bytes32.zero
XCTAssertEqual(zero.hex, "0x" + String(repeating: "00", count: 64))
Was this page helpful?