⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hash.h

📁 模仿cisco路由器
💻 H
字号:
/*
	Copyright (C) 2002, 2003 Slava Astashonok <sla@0n.ru>

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License.

	$Id: hash.h,v 1.1.1.1.2.1 2003/03/28 22:57:51 sla Exp $
*/

#ifndef _HASH_H_
#define _HASH_H_

#ifndef HASH_TYPE_XOR
# ifndef HASH_TYPE_CRC
#  error HASH_TYPE_XOR or HASH_TYPE_CRC must be defined
# endif
#else
# ifdef HASH_TYPE_CRC
#  error HASH_TYPE_XOR or HASH_TYPE_CRC must be defined
# endif
#endif

#if HASH_BITS != 16
# ifdef HASH_TYPE_CRC
#  error illegal value in HASH_BITS
# endif
# if HASH_BITS != 8
#  error illegal value in HASH_BITS
# endif
#endif

#define CRC16_POLY  0x8005
/*
#define CRC16_POLY  0x1021
*/

#include <inttypes.h>

#if HASH_BITS == 8
typedef uint8_t hash_t;
#endif

#if HASH_BITS == 16
typedef uint16_t hash_t;
#endif

uint16_t crc16(uint16_t, uint8_t);
hash_t hash(void *, int);
void hash_init();

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -