pub(crate) fn reverse(needle: &[u8]) -> NeedleHash {
        let mut nh = NeedleHash { hash: Hash::new(), hash_2pow: 1 };
        if needle.is_empty() {
            return nh;
        }
        nh.hash.add(needle[needle.len() - 1]);
        for &b in needle.iter().rev().skip(1) {
            nh.hash.add(b);
            nh.hash_2pow = nh.hash_2pow.wrapping_shl(1);
        }
        nh
    }
/// Create a new Rabin-Karp hash for the given needle for use in reverse
/// searching.
Create a new Rabin-Karp hash for the given needle for use in reverse
searching.
Create a new Rabin - Karp hash for the given needle for use in reverse searching .
pub(crate) fn reverse(needle: &[u8]) -> NeedleHash {
        let mut nh = NeedleHash { hash: Hash::new(), hash_2pow: 1 };
        if needle.is_empty() {
            return nh;
        }
        nh.hash.add(needle[needle.len() - 1]);
        for &b in needle.iter().rev().skip(1) {
            nh.hash.add(b);
            nh.hash_2pow = nh.hash_2pow.wrapping_shl(1);
        }
        nh
    }
pub ( crate ) fn reverse ( needle : & [ u8 ] ) -> NeedleHash { let mut nh = NeedleHash { hash : Hash :: new ( ) , hash_2pow : 1 } ; if needle . is_empty ( ) { return nh ; } nh . hash . add ( needle [ needle . len ( ) - 1 ] ) ; for & b in needle . iter ( ) . rev ( ) . skip ( 1 ) { nh . hash . add ( b ) ; nh . hash_2pow = nh . hash_2pow . wrapping_shl ( 1 ) ; } nh }
Create a new Rabin-Karp hash for the given needle for use in reverse
searching.
Create a new Rabin - Karp hash for the given needle for use in reverse searching .
needle
&[u8]
needle
&[u8]