add xor def
This commit is contained in:
parent
a561656b68
commit
f7397a5970
|
@ -53,6 +53,7 @@
|
|||
- [`Eth1DataVote`](#eth1datavote)
|
||||
- [Custom Types](#custom-types)
|
||||
- [Helper functions](#helper-functions)
|
||||
- [`xor`](#xor)
|
||||
- [`hash`](#hash)
|
||||
- [`hash_tree_root`](#hash_tree_root)
|
||||
- [`signed_root`](#signed_root)
|
||||
|
@ -652,6 +653,13 @@ We define the following Python custom types for type hinting and readability:
|
|||
|
||||
Note: The definitions below are for specification purposes and are not necessarily optimal implementations.
|
||||
|
||||
### `xor`
|
||||
|
||||
```python
|
||||
def xor(bytes1: Bytes32, bytes2: Bytes32) -> Bytes32:
|
||||
return bytes(a ^ b for a, b in zip(bytes1, bytes2))
|
||||
```
|
||||
|
||||
### `hash`
|
||||
|
||||
The hash function is denoted by `hash`. In Phase 0 the beacon chain is deployed with the same hash function as Ethereum 1.0, i.e. Keccak-256 (also incorrectly known as SHA3).
|
||||
|
|
Loading…
Reference in New Issue