Skip to content
File

Blob: src/workerd/api/crypto/crc-impl.h

cpp15 lines
1// Copyright (c) 2017-2025 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4 
5#pragma once
6#include <stdint.h>
7 
8// crc32-c implementation according to the spec:
9// https://reveng.sourceforge.io/crc-catalogue/all.htm#crc.cat.crc-32-iscsi
10uint32_t crc32c(uint32_t crc, const uint8_t *data, unsigned int length);
11 
12// crc64-nvme implementation according to the spec:
13// https://reveng.sourceforge.io/crc-catalogue/all.htm#crc.cat.crc-64-nvme
14uint64_t crc64nvme(uint64_t crc, const uint8_t *data, unsigned int length);