Non dependency hashing
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "utils/hash.hpp"
|
||||
|
||||
|
||||
#define XXH_INLINE_ALL
|
||||
#include "contrib/xxhash.hpp"
|
||||
|
||||
@@ -10,7 +9,7 @@
|
||||
|
||||
namespace dropshell {
|
||||
|
||||
XXH64_hash_t hash_file(const std::string &path) {
|
||||
uint64_t hash_file(const std::string &path) {
|
||||
// Create hash state
|
||||
XXH3_state_t* const state = XXH3_createState();
|
||||
if (state == nullptr) {
|
||||
@@ -55,7 +54,7 @@ XXH64_hash_t hash_file(const std::string &path) {
|
||||
return hash;
|
||||
}
|
||||
|
||||
XXH64_hash_t hash_directory_recursive(const std::string &path) {
|
||||
uint64_t hash_directory_recursive(const std::string &path) {
|
||||
// Create hash state
|
||||
XXH3_state_t* const state = XXH3_createState();
|
||||
if (state == nullptr) {
|
||||
|
@@ -1,14 +1,14 @@
|
||||
#ifndef HASH_HPP
|
||||
#define HASH_HPP
|
||||
|
||||
#include <xxhash.h>
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
namespace dropshell {
|
||||
|
||||
XXH64_hash_t hash_file(const std::string &path);
|
||||
uint64_t hash_file(const std::string &path);
|
||||
|
||||
XXH64_hash_t hash_directory_recursive(const std::string &path);
|
||||
uint64_t hash_directory_recursive(const std::string &path);
|
||||
|
||||
void hash_demo(const std::string & path);
|
||||
|
||||
|
Reference in New Issue
Block a user