blob: 2906bafb1b1aecccd1663820f8831a77d2866954 [file] [log] [blame]
/*
* Copyright (c) 2018 Google LLC.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <crc.h>
u8_t crc7_be(u8_t seed, const u8_t *src, size_t len)
{
while (len--) {
u8_t e = seed ^ *src++;
u8_t f = e ^ (e >> 4) ^ (e >> 7);
seed = (f << 1) ^ (f << 4);
}
return seed;
}