diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/public/tier1/checksum_md5.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/public/tier1/checksum_md5.h')
| -rw-r--r-- | mp/src/public/tier1/checksum_md5.h | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/mp/src/public/tier1/checksum_md5.h b/mp/src/public/tier1/checksum_md5.h index 34f82823..e7cf7ec9 100644 --- a/mp/src/public/tier1/checksum_md5.h +++ b/mp/src/public/tier1/checksum_md5.h @@ -1,62 +1,62 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Generic MD5 hashing algo
-//
-//=============================================================================//
-
-#ifndef CHECKSUM_MD5_H
-#define CHECKSUM_MD5_H
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-// 16 bytes == 128 bit digest
-#define MD5_DIGEST_LENGTH 16
-#define MD5_BIT_LENGTH ( MD5_DIGEST_LENGTH * sizeof(unsigned char) )
-struct MD5Value_t
-{
- unsigned char bits[MD5_DIGEST_LENGTH];
-
- void Zero();
- bool IsZero() const;
-
- bool operator==( const MD5Value_t &src ) const;
- bool operator!=( const MD5Value_t &src ) const;
-
-};
-
-// MD5 Hash
-typedef struct
-{
- unsigned int buf[4];
- unsigned int bits[2];
- unsigned char in[64];
-} MD5Context_t;
-
-void MD5Init( MD5Context_t *context );
-void MD5Update( MD5Context_t *context, unsigned char const *buf, unsigned int len );
-void MD5Final( unsigned char digest[ MD5_DIGEST_LENGTH ], MD5Context_t *context );
-
-char *MD5_Print(unsigned char *digest, int hashlen );
-
-/// Convenience wrapper to calculate the MD5 for a buffer, all in one step, without
-/// bothering with the context object.
-void MD5_ProcessSingleBuffer( const void *p, int len, MD5Value_t &md5Result );
-
-unsigned int MD5_PseudoRandom(unsigned int nSeed);
-
-/// Returns true if the values match.
-bool MD5_Compare( const MD5Value_t &data, const MD5Value_t &compare );
-
-inline bool MD5Value_t::operator==( const MD5Value_t &src ) const
-{
- return MD5_Compare( *this, src );
-}
-
-inline bool MD5Value_t::operator!=( const MD5Value_t &src ) const
-{
- return !MD5_Compare( *this, src );
-}
-
-#endif // CHECKSUM_MD5_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Generic MD5 hashing algo +// +//=============================================================================// + +#ifndef CHECKSUM_MD5_H +#define CHECKSUM_MD5_H + +#ifdef _WIN32 +#pragma once +#endif + +// 16 bytes == 128 bit digest +#define MD5_DIGEST_LENGTH 16 +#define MD5_BIT_LENGTH ( MD5_DIGEST_LENGTH * sizeof(unsigned char) ) +struct MD5Value_t +{ + unsigned char bits[MD5_DIGEST_LENGTH]; + + void Zero(); + bool IsZero() const; + + bool operator==( const MD5Value_t &src ) const; + bool operator!=( const MD5Value_t &src ) const; + +}; + +// MD5 Hash +typedef struct +{ + unsigned int buf[4]; + unsigned int bits[2]; + unsigned char in[64]; +} MD5Context_t; + +void MD5Init( MD5Context_t *context ); +void MD5Update( MD5Context_t *context, unsigned char const *buf, unsigned int len ); +void MD5Final( unsigned char digest[ MD5_DIGEST_LENGTH ], MD5Context_t *context ); + +char *MD5_Print(unsigned char *digest, int hashlen ); + +/// Convenience wrapper to calculate the MD5 for a buffer, all in one step, without +/// bothering with the context object. +void MD5_ProcessSingleBuffer( const void *p, int len, MD5Value_t &md5Result ); + +unsigned int MD5_PseudoRandom(unsigned int nSeed); + +/// Returns true if the values match. +bool MD5_Compare( const MD5Value_t &data, const MD5Value_t &compare ); + +inline bool MD5Value_t::operator==( const MD5Value_t &src ) const +{ + return MD5_Compare( *this, src ); +} + +inline bool MD5Value_t::operator!=( const MD5Value_t &src ) const +{ + return !MD5_Compare( *this, src ); +} + +#endif // CHECKSUM_MD5_H |