Download rust/crates/hyperkitty-continuity/src/seed_chain.rs from Snapkitty/hyperkitty-constraint-dsl: direct link, hf CLI and curl.
- Browser
- Download file 473 Bytes
-
https://huggingface.co/Snapkitty/hyperkitty-constraint-dsl/resolve/main/rust/crates/hyperkitty-continuity/src/seed_chain.rs
- Command line
-
hf download hf://Snapkitty/hyperkitty-constraint-dsl/rust/crates/hyperkitty-continuity/src/seed_chain.rs
-
curl -L -o seed_chain.rs https://huggingface.co/Snapkitty/hyperkitty-constraint-dsl/resolve/main/rust/crates/hyperkitty-continuity/src/seed_chain.rs
473 Bytes
| pub struct SeedChain { | |
| pub seed: [u8; 32], | |
| pub index: u64, | |
| } | |
| impl SeedChain { | |
| pub fn genesis(initial_seed: &[u8; 32]) -> Self { | |
| Self { | |
| seed: *initial_seed, | |
| index: 0, | |
| } | |
| } | |
| pub fn advance(&mut self, _operation: &[u8]) -> [u8; 32] { | |
| self.index += 1; | |
| self.seed | |
| } | |
| pub fn current_seed(&self) -> &[u8; 32] { | |
| &self.seed | |
| } | |
| pub fn index(&self) -> u64 { | |
| self.index | |
| } | |
| } | |