PR feedback from @ericsson49: fix when `len(bytez) > BYTES_PER_CUSTODY_ATOM`
This commit is contained in:
parent
eaae70b3b3
commit
966363890b
|
@ -229,7 +229,8 @@ Given one set of data, return the custody atoms: each atom will be combined with
|
|||
|
||||
```python
|
||||
def get_custody_atoms(bytez: bytes) -> Sequence[bytes]:
|
||||
bytez += b'\x00' * ((BYTES_PER_CUSTODY_ATOM - len(bytez)) % BYTES_PER_CUSTODY_ATOM) # right-padding
|
||||
length_remainder = len(bytez) % BYTES_PER_CUSTODY_ATOM
|
||||
bytez += b'\x00' * ((BYTES_PER_CUSTODY_ATOM - length_remainder) % BYTES_PER_CUSTODY_ATOM) # right-padding
|
||||
return [
|
||||
bytez[i:i + BYTES_PER_CUSTODY_ATOM]
|
||||
for i in range(0, len(bytez), BYTES_PER_CUSTODY_ATOM)
|
||||
|
|
Loading…
Reference in New Issue