Skip to content

Commit

Permalink
Add docstring into get_split_offset
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuterin committed Mar 21, 2019
1 parent 422c607 commit fdcfc91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,10 @@ def get_permuted_index(index: int, list_size: int, seed: Bytes32) -> int:

```python
def get_split_offset(list_length: int, split_count: int, index: int) -> int:
"""
Returns a value such that for a list L, chunk count k and index i,
split(L, k)[i] == L[get_split_offset(len(L), k, i): get_split_offset(len(L), k, i + 1)]
"""
return (list_length * index) // split_count
```

Expand Down

0 comments on commit fdcfc91

Please sign in to comment.