Function fuzzyhash::hash_buffer_raw [] [src]

#[no_mangle]
pub extern "C" fn hash_buffer_raw(buf: *const u8, length: usize) -> *mut i8

Returns the fuzzy hash of arbitrary data. This method provides better FFI compatibility.

Arguments

  • buf - a pointer to the array containing the data to hash
  • length - length of buf # Example ``` use fuzzyhash::{hash_buffer_raw}; use std::ffi::CString;

let data = "this is our test data!".to_string(); let hash = unsafe { CString::from_raw(hash_buffer_raw(data.as_bytes().as_ptr(), data.len())) }; println!("Fuzzy Hash: {}", hash.into_string().unwrap()); ```