mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-12 02:09:00 -05:00
9 lines
295 B
Rust
9 lines
295 B
Rust
use ring::{digest, digest::SHA256};
|
|
|
|
#[tracing::instrument(skip_all, level = "debug")]
|
|
pub(super) fn hash(keys: &[&[u8]]) -> Vec<u8> {
|
|
// We only hash the pdu's event ids, not the whole pdu
|
|
let bytes = keys.join(&0xFF);
|
|
let hash = digest::digest(&SHA256, &bytes);
|
|
hash.as_ref().to_owned()
|
|
}
|