]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/linux/crc8.h
Merge branch 'master' of git://git.denx.de/u-boot-socfpga
[people/ms/u-boot.git] / include / linux / crc8.h
CommitLineData
60d18d3f
SG
1/*
2 * Copyright (c) 2013 Google, Inc
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7
8#ifndef __linux_crc8_h
9#define __linux_crc8_h
10
11/**
12 * crc8() - Calculate and return CRC-8 of the data
13 *
14 * This uses an x^8 + x^2 + x + 1 polynomial. A table-based algorithm would
15 * be faster, but for only a few bytes it isn't worth the code size
16 *
17 * @vptr: Buffer to checksum
18 * @len: Length of buffer in bytes
19 * @return CRC8 checksum
20 */
21unsigned int crc8(const unsigned char *vptr, int len);
22
23#endif