mod aggregate_hash;
mod hash_sections;
mod projection_hash;
mod shape_signature;
use crate::db::codec::{finalize_hash_sha256, new_hash_sha256_prefixed};
#[cfg(feature = "sql")]
use crate::db::query::{
fingerprint::projection_hash::hash_scalar_filter_expr_structural_fingerprint, plan::expr::Expr,
};
#[cfg(feature = "sql")]
use crate::error::InternalError;
use sha2::Sha256;
const CONTINUATION_SIGNATURE_PROFILE_TAG: &[u8] = b"contsig";
#[cfg(feature = "sql")]
const RESUMABLE_UPDATE_SCOPE_FINGERPRINT_PROFILE_TAG: &[u8] = b"resumable_update_scope_v1";
pub(in crate::db::query::fingerprint) fn new_continuation_signature_hasher() -> Sha256 {
new_hash_sha256_prefixed(CONTINUATION_SIGNATURE_PROFILE_TAG)
}
pub(in crate::db::query::fingerprint) fn finalize_sha256_digest(hasher: Sha256) -> [u8; 32] {
finalize_hash_sha256(hasher)
}
#[cfg(feature = "sql")]
pub(in crate::db) fn resumable_update_scope_fingerprint(
expr: &Expr,
) -> Result<[u8; 32], InternalError> {
let mut hasher = new_hash_sha256_prefixed(RESUMABLE_UPDATE_SCOPE_FINGERPRINT_PROFILE_TAG);
hash_scalar_filter_expr_structural_fingerprint(&mut hasher, expr)?;
Ok(finalize_hash_sha256(hasher))
}