Update specs/core/0_beacon-chain.md

Co-Authored-By: vbuterin <v@buterin.com>
This commit is contained in:
Danny Ryan 2019-02-06 18:33:22 -06:00 committed by GitHub
parent 37b41a2ce6
commit 4ec721f3b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -697,6 +697,13 @@ def get_active_validator_indices(validators: List[Validator], epoch: EpochNumber
```python
def shuffle(values: List[Any], seed: Bytes32) -> List[Any]:
"""
Return the shuffled ``values`` with ``seed`` as entropy.
Utilizes 'swap or not' shuffling found in
https://link.springer.com/content/pdf/10.1007%2F978-3-642-32009-5_1.pdf
See the 'generalized domain' algorithm on page 3.
"""
indices = list(range(len(values)))
for round in range(90):
hashvalues = b''.join([