clarify endianness
This commit is contained in:
parent
ea6a3b293c
commit
9582814c62
|
@ -559,9 +559,7 @@ def xor(bytes_1: Bytes32, bytes_2: Bytes32) -> Bytes32:
|
|||
```python
|
||||
def int_to_bytes(n: uint64, length: uint64) -> bytes:
|
||||
"""
|
||||
Return the ``length``-byte serialization of ``n``.
|
||||
``n.to_bytes(length, endianness)`` returns ``n`` in endianness-endian bytes padded out to length bytes.
|
||||
|
||||
Return the ``length``-byte serialization of ``n`` in ``ENDIANNESS``-endian.
|
||||
"""
|
||||
return n.to_bytes(length, ENDIANNESS)
|
||||
```
|
||||
|
@ -571,8 +569,7 @@ def int_to_bytes(n: uint64, length: uint64) -> bytes:
|
|||
```python
|
||||
def bytes_to_int(data: bytes) -> uint64:
|
||||
"""
|
||||
Return the integer deserialization of ``data``.
|
||||
``n.to_bytes(data, endianness)`` returns ``data`` as in integer intepretted in endianness-endian.
|
||||
Return the integer deserialization of ``data`` intepretted as ``ENDIANNESS``-endian.
|
||||
"""
|
||||
return int.from_bytes(data, ENDIANNESS)
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue