| 1 |
/* adler32.c -- compute the Adler-32 checksum of a data stream |
| 2 |
* Copyright (C) 1995-2003 Mark Adler |
| 3 |
|
| 4 |
THIS IS A MODIFIED VERSION OF THE ORIGINAL ZLIB adler32.c! |
| 5 |
|
| 6 |
The following was copied from zlib.h: |
| 7 |
|
| 8 |
This software is provided 'as-is', without any express or implied |
| 9 |
warranty. In no event will the authors be held liable for any damages |
| 10 |
arising from the use of this software. |
| 11 |
|
| 12 |
Permission is granted to anyone to use this software for any purpose, |
| 13 |
including commercial applications, and to alter it and redistribute it |
| 14 |
freely, subject to the following restrictions: |
| 15 |
|
| 16 |
1. The origin of this software must not be misrepresented; you must not |
| 17 |
claim that you wrote the original software. If you use this software |
| 18 |
in a product, an acknowledgment in the product documentation would be |
| 19 |
appreciated but is not required. |
| 20 |
2. Altered source versions must be plainly marked as such, and must not be |
| 21 |
misrepresented as being the original software. |
| 22 |
3. This notice may not be removed or altered from any source distribution. |
| 23 |
|
| 24 |
Reviewed for Unicode support by Jim Park -- 08/29/2007 |
| 25 |
(nothing changed.) |
| 26 |
*/ |
| 27 |
|
| 28 |
#include "adler32.h" |
| 29 |
#include <limits.h> |
| 30 |
namespace zlib { |
| 31 |
#include <zlib.h> |
| 32 |
} |
| 33 |
|
| 34 |
namespace Checksum { |
| 35 |
|
| 36 |
/* ========================================================================= */ |
| 37 |
uLong adler32(uLong adler, const Byte *buf, uInt len) { |
| 38 |
return zlib::adler32(adler, buf, len); |
| 39 |
} |
| 40 |
} |