TARFS 0.1.5
Read-only TAR filesystem for ESP32
Loading...
Searching...
No Matches
hash.h
Go to the documentation of this file.
1/*
2 * TARFS - Immutable (read-only) filesystem for embedded systems.
3 *
4 * Copyright (c) 2026 Viacheslav Logunov
5 * SPDX-License-Identifier: MMIT
6 *
7 * Author:
8 * Viacheslav Logunov <vvb333007@gmail.com>
9 *
10 * Project:
11 * https://github.com/vvb333007/tarfs
12 *
13 * @file hash.h
14 * @brief Public hash functions API
15 */
16
17
22
23#pragma once
24
25#include <stdint.h>
26#include <stddef.h> /* size_t */
27
28#define HASH32_IV (uint32_t)(2166136261u)
29#define HASH32_SLASH (uint32_t)(0x2a0c975eu)
30#define HASH64_IV 0ULL
31
32#ifdef __cplusplus
33extern "C" {
34#endif
52uint32_t hash32(uint32_t prev_hash, uint8_t const *data, size_t len);
53
54
72uint64_t hash64(uint64_t prev_hash, void const *data, size_t len);
73
74#ifdef __cplusplus
75};
76#endif
uint32_t hash32(uint32_t prev_hash, uint8_t const *data, size_t len)
Compute FNV-1a hash over a byte buffer.
Definition hash.c:79
uint64_t hash64(uint64_t prev_hash, void const *data, size_t len)
Compute CRC64/ECMA182 hash over a byte buffer.
Definition hash.c:163