Add docstring into get_split_offset

This commit is contained in:
vbuterin 2019-03-21 07:38:25 -05:00 committed by GitHub
parent 422c607f74
commit fdcfc91008
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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
```