Skip to content

Commit

Permalink
PR feedback from @ericsson49: fix when `len(bytez) > BYTES_PER_CUSTOD…
Browse files Browse the repository at this point in the history
…Y_ATOM`
  • Loading branch information
hwwhww authored Jun 30, 2020
1 parent eaae70b commit 9663638
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion specs/phase1/custody-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9663638

Please sign in to comment.