Apollo 11.0
自动驾驶开放平台
file_utility.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16#pragma once
17
18#include <fcntl.h>
19#include <sys/stat.h>
20#include <sys/types.h>
21#include <unistd.h>
22#include <cstdio>
23#include <cstring>
24#include <fstream>
25#include <sstream>
26#include <string>
27#include <vector>
28
29#include "cyber/common/log.h"
30
31namespace apollo {
32namespace localization {
33namespace msf {
34
36 public:
37 static const size_t kUcharMd5Length = 16;
38 static const size_t kCharMd5Lenth = 33;
40 static void ComputeFileMd5(const std::string& file_path,
41 unsigned char res[kUcharMd5Length]);
42 static void ComputeFileMd5(const std::string& file_path,
43 char res[kCharMd5Lenth]);
45 static void ComputeBinaryMd5(const unsigned char* binary, size_t size,
46 unsigned char res[kUcharMd5Length]);
47 static void ComputeBinaryMd5(const unsigned char* binary, size_t size,
48 char res[kCharMd5Lenth]);
49};
50
51} // namespace msf
52} // namespace localization
53} // namespace apollo
static void ComputeFileMd5(const std::string &file_path, unsigned char res[kUcharMd5Length])
Compute file md5 given a file path.
static void ComputeBinaryMd5(const unsigned char *binary, size_t size, unsigned char res[kUcharMd5Length])
Compute file md5 given a binary chunk.
class register implement
Definition arena_queue.h:37