| 1 |
/* |
| 2 |
* dummy.c, a fake hash algorithm, just to test integration capabilities. |
| 3 |
* Part of the xxHash project |
| 4 |
* Copyright (C) 2020 Yann Collet |
| 5 |
* |
| 6 |
* GPL v2 License |
| 7 |
* |
| 8 |
* This program is free software; you can redistribute it and/or modify |
| 9 |
* it under the terms of the GNU General Public License as published by |
| 10 |
* the Free Software Foundation; either version 2 of the License, or |
| 11 |
* (at your option) any later version. |
| 12 |
* |
| 13 |
* This program is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
* GNU General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU General Public License along |
| 19 |
* with this program; if not, write to the Free Software Foundation, Inc., |
| 20 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 21 |
* |
| 22 |
* You can contact the author at: |
| 23 |
* - xxHash homepage: https://www.xxhash.com |
| 24 |
* - xxHash source repository: https://github.com/Cyan4973/xxHash |
| 25 |
*/ |
| 26 |
|
| 27 |
|
| 28 |
#include <dummy.h> |
| 29 |
|
| 30 |
unsigned badsum32(const void* input, size_t len, unsigned seed) |
| 31 |
{ |
| 32 |
unsigned sum = seed; |
| 33 |
const unsigned char* in8 = input; |
| 34 |
size_t c; |
| 35 |
for (c=0; c<len; c++) |
| 36 |
sum += in8[c]; |
| 37 |
return sum; |
| 38 |
} |