Fix #8316: Make sort industries by production and transported with a cargo filter...
[openttd-github.git] / src / 3rdparty / md5 / md5.h
blob049c001d8d4d00658a8195235533f3f62429ee81
1 /** @file md5.h Functions to create MD5 checksums. */
3 /*
4 Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
6 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any damages
8 arising from the use of this software.
10 Permission is granted to anyone to use this software for any purpose,
11 including commercial applications, and to alter it and redistribute it
12 freely, subject to the following restrictions:
14 1. The origin of this software must not be misrepresented; you must not
15 claim that you wrote the original software. If you use this software
16 in a product, an acknowledgment in the product documentation would be
17 appreciated but is not required.
18 2. Altered source versions must be plainly marked as such, and must not be
19 misrepresented as being the original software.
20 3. This notice may not be removed or altered from any source distribution.
22 L. Peter Deutsch
23 ghost@aladdin.com
28 Independent implementation of MD5 (RFC 1321).
30 This code implements the MD5 Algorithm defined in RFC 1321, whose
31 text is available at
32 http://www.ietf.org/rfc/rfc1321.txt
33 The code is derived from the text of the RFC, including the test suite
34 (section A.5) but excluding the rest of Appendix A. It does not include
35 any code or documentation that is identified in the RFC as being
36 copyrighted.
38 The original and principal author of md5.h is L. Peter Deutsch
39 <ghost@aladdin.com>. Other authors are noted in the change history
40 that follows (in reverse chronological order):
42 2007-12-24 Changed to C++ and adapted to OpenTTD source
43 2002-04-13 lpd Removed support for non-ANSI compilers; removed
44 references to Ghostscript; clarified derivation from RFC 1321;
45 now handles byte order either statically or dynamically.
46 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
47 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
48 added conditionalization for C++ compilation from Martin
49 Purschke <purschke@bnl.gov>.
50 1999-05-03 lpd Original version.
53 #ifndef MD5_INCLUDED
54 #define MD5_INCLUDED
56 struct Md5 {
57 private:
58 uint32 count[2]; ///< message length in bits, lsw first
59 uint32 abcd[4]; ///< digest buffer
60 uint8 buf[64]; ///< accumulate block
62 void Process(const uint8 *data);
64 public:
65 Md5();
66 void Append(const void *data, const size_t nbytes);
67 void Finish(uint8 digest[16]);
70 #endif /* MD5_INCLUDED */