Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / comphelper / hash.hxx
blobd8145604ac6b497e7faf50832e99f900e6143068
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <comphelper/comphelperdllapi.h>
12 #include <memory>
13 #include <vector>
15 namespace comphelper {
17 enum class HashType
19 MD5,
20 SHA1,
21 SHA256,
22 SHA512
25 struct HashImpl;
27 class COMPHELPER_DLLPUBLIC Hash
29 private:
30 std::unique_ptr<HashImpl> mpImpl;
32 public:
34 Hash(HashType eType);
35 ~Hash();
37 void update(const unsigned char* pInput, size_t length);
39 std::vector<unsigned char> finalize();
41 static std::vector<unsigned char> calculateHash(const unsigned char* pInput, size_t length, HashType eType);
43 size_t getLength() const;
48 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */