Created
April 9, 2019 13:32
-
-
Save aep/e625c59aa6e2dbad6a56a97211cb8aeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::hash::{Hash, Hasher}; | |
use std::collections::hash_map::DefaultHasher; | |
let mut hasher = DefaultHasher::new(); | |
identity.hash(&mut hasher); | |
let r = hasher.finish(); | |
if r % shard_count as u64 == shard as u64 { | |
// work on this thing | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment