Blender  V3.3
md5.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Zlib
2  * Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
3  * L. Peter Deutsch
4  * ghost@aladdin.com */
5 
6 /* MD5
7  *
8  * Simply MD5 hash computation, used by disk cache. Adapted from external
9  * code, with minor code modifications done to remove some unused code and
10  * change code style. */
11 
12 #ifndef __UTIL_MD5_H__
13 #define __UTIL_MD5_H__
14 
15 #include "util/string.h"
16 #include "util/types.h"
17 
19 
20 class MD5Hash {
21  public:
22  MD5Hash();
23  ~MD5Hash();
24 
25  void append(const uint8_t *data, int size);
26  void append(const string &str);
27  bool append_file(const string &filepath);
28  string get_hex();
29 
30  protected:
31  void process(const uint8_t *data);
32  void finish(uint8_t digest[16]);
33 
34  uint32_t count[2]; /* message length in bits, LSW first. */
35  uint32_t abcd[4]; /* digest buffer */
36  uint8_t buf[64]; /* accumulate block */
37 };
38 
39 string util_md5_string(const string &str);
40 
42 
43 #endif /* __UTIL_MD5_H__ */
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Definition: md5.h:20
bool append_file(const string &filepath)
Definition: md5.cpp:300
string get_hex()
Definition: md5.cpp:348
uint8_t buf[64]
Definition: md5.h:36
~MD5Hash()
Definition: md5.cpp:252
void finish(uint8_t digest[16])
Definition: md5.cpp:325
MD5Hash()
Definition: md5.cpp:243
void append(const uint8_t *data, int size)
Definition: md5.cpp:256
void process(const uint8_t *data)
Definition: md5.cpp:82
uint32_t abcd[4]
Definition: md5.h:35
uint32_t count[2]
Definition: md5.h:34
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
#define str(s)
string util_md5_string(const string &str)
Definition: md5.cpp:362
unsigned int uint32_t
Definition: stdint.h:80
unsigned char uint8_t
Definition: stdint.h:78