Loading...
Searching...
No Matches
fletcher32.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Eistec AB
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
19
20#include <stdlib.h>
21#include <stdint.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
30typedef struct {
31 uint32_t sum1;
32 uint32_t sum2;
34
49uint32_t fletcher32(const uint16_t *buf, size_t words);
50
59
71void fletcher32_update(fletcher32_ctx_t *ctx, const void *data, size_t words);
72
81
82#ifdef __cplusplus
83}
84#endif
85
uint32_t fletcher32_finish(fletcher32_ctx_t *ctx)
Finalize the checksum operation and return the checksum.
void fletcher32_init(fletcher32_ctx_t *ctx)
Initialize a fletcher32 context.
uint32_t fletcher32(const uint16_t *buf, size_t words)
Fletcher's 32 bit checksum.
void fletcher32_update(fletcher32_ctx_t *ctx, const void *data, size_t words)
Incrementally update the fletcher32 context with new data.
Fletcher's 32 bit checksum context struct.
Definition fletcher32.h:30
uint32_t sum2
Second sum of the checksum.
Definition fletcher32.h:32
uint32_t sum1
First sum of the checksum.
Definition fletcher32.h:31