MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
md5.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by Longda on 2010
13//
14
15#pragma once
16
17#include <stdio.h>
18namespace common {
19
20typedef unsigned char *POINTER;
21typedef unsigned short int UINT2;
22typedef unsigned int UINT4;
23
24typedef struct
25{
26 UINT4 state[4]; /* state (ABCD) */
27 UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
28 unsigned char buffer[64]; /* input buffer */
29} MD5_CTX;
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41int MD5String(char *string, unsigned char digest[16]);
42
49int MD5File(char *filename, unsigned char digest[16]);
50
58int MD5Buffer(char *buffer, unsigned int len, unsigned char digest[16]);
59
60void MD5Init(MD5_CTX *);
61
62void MD5Update(MD5_CTX *, unsigned char *, unsigned int);
63
64void MD5Final(unsigned char[16], MD5_CTX *);
65
66#ifdef __cplusplus
67}
68#endif
69
70} // namespace common
Definition: md5.h:25