Skip to main content

tensordb_native/
lib.rs

1#[cxx::bridge]
2mod ffi {
3    #[namespace = "tensordb_native"]
4    unsafe extern "C++" {
5        include!("tensordb_native.h");
6
7        fn native_hash64(bytes: &[u8]) -> u64;
8        fn native_hash_call_count() -> u64;
9        fn native_hash_reset_count();
10    }
11}
12
13pub fn hash64(bytes: &[u8]) -> u64 {
14    ffi::native_hash64(bytes)
15}
16
17pub fn hash_call_count() -> u64 {
18    ffi::native_hash_call_count()
19}
20
21pub fn reset_hash_call_count() {
22    ffi::native_hash_reset_count();
23}