fn next(&mut self) -> Option<Self::Item> {
                loop {
                    self.hasher.update(self.door_id).ok()?;
                    self.hasher.update(self.index.to_string().as_bytes()).ok()?;
                    // NOTE: finish() will reset the hasher state so we can reuse it later on.
                    let hash = self.hasher.finish().ok()?;
                    self.index += 1;
                    // Since one byte is two characters in hex representation, we test the first two
                    // byte and the most significants 4 bits ("high part") of the third.
                    if (hash[0] | hash[1] | (hash[2] & 0xf0)) == 0 {
                        let hex = hash.iter().map(|byte| format!("{:02x}", byte)).collect();
                        return Some(hex);
                    }
                }
            }
/// Find the next interesting hash in the index sequence.
///
/// > A hash indicates the next character in the password if its hexadecimal representation
/// > starts with five zeroes.
Find the next interesting hash in the index sequence.
> A hash indicates the next character in the password if its hexadecimal representation
> starts with five zeroes.
Find the next interesting hash in the index sequence . > A hash indicates the next character in the password if its hexadecimal representation > starts with five zeroes .
fn next(&mut self) -> Option<Self::Item> {
                loop {
                    self.hasher.update(self.door_id).ok()?;
                    self.hasher.update(self.index.to_string().as_bytes()).ok()?;
                    // NOTE: finish() will reset the hasher state so we can reuse it later on.
                    let hash = self.hasher.finish().ok()?;
                    self.index += 1;
                    // Since one byte is two characters in hex representation, we test the first two
                    // byte and the most significants 4 bits ("high part") of the third.
                    if (hash[0] | hash[1] | (hash[2] & 0xf0)) == 0 {
                        let hex = hash.iter().map(|byte| format!("{:02x}", byte)).collect();
                        return Some(hex);
                    }
                }
            }
fn next ( & mut self ) -> Option < Self :: Item > { loop { self . hasher . update ( self . door_id ) . ok ( ) ? ; self . hasher . update ( self . index . to_string ( ) . as_bytes ( ) ) . ok ( ) ? ; // NOTE: finish() will reset the hasher state so we can reuse it later on. let hash = self . hasher . finish ( ) . ok ( ) ? ; self . index += 1 ; // Since one byte is two characters in hex representation, we test the first two // byte and the most significants 4 bits ("high part") of the third. if ( hash [ 0 ] | hash [ 1 ] | ( hash [ 2 ] & 0xf0 ) ) == 0 { let hex = hash . iter ( ) . map ( | byte | format ! ( " " byte ) ) . collect ( ) ; return Some ( hex ) ; } } }
Find the next interesting hash in the index sequence.
Find the next interesting hash in the index sequence .
&mut self
&mut self