Skip to content

Commit ff0198b

Browse files
committed
Rebuild header file with docs
1 parent b737ab1 commit ff0198b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crc32fast.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,31 @@
44
#include <ostream>
55
#include <new>
66

7+
/// Opaque type for C for use in FFI
78
struct HasherHandle {
89
Hasher *_0;
910
};
1011

1112
extern "C" {
1213

14+
/// Creates a new Hasher to compute CRC32 checksums
1315
HasherHandle *hasher_new();
1416

17+
/// Writes data to the Hasher
18+
///
1519
/// # Safety
1620
///
1721
/// Uses unsafe method calls
1822
void hasher_write(HasherHandle *handle, const char *data, uintptr_t len);
1923

24+
/// Calculates the CRC32 checksum for data that's been written to the Hasher
25+
///
2026
/// # Safety
2127
///
2228
/// Uses unsafe method calls
2329
uint32_t hasher_finalize(HasherHandle *handle);
2430

31+
/// Helper method to just calculate a CRC32 checksum directly for a string
2532
uint32_t crc32_hash(const char *data, uintptr_t len);
2633

2734
} // extern "C"

0 commit comments

Comments
 (0)