pagefind 1.5.1

Implement search on any static website.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use sha1::{Digest, Sha1};

/// Symbols that count as part of a word
/// (specifically, the "Punctuation, Connector" Unicode category)
pub const WORD_SYMBOLS: [char; 10] = ['_', '', '', '', '', '', '', '', '', '_'];

pub fn full_hash(bytes: &[u8]) -> String {
    let mut hasher = Sha1::new();
    hasher.update(bytes);
    hasher
        .finalize()
        .iter()
        .map(|b| format!("{:x?}", b))
        .collect::<Vec<String>>()
        .join("")
}