Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MD5HashAlgorithm.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* MD5HashAlgorithm.h (C) 2000-2023 */
9/* */
10/* Calculates the MD5 hashing function. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_MD5HASHALGORITHM_H
13#define ARCANE_UTILS_MD5HASHALGORITHM_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/IHashAlgorithm.h"
18#include "arcane/utils/String.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
34class ARCANE_UTILS_EXPORT MD5HashAlgorithm
35: public IHashAlgorithm
36{
37 public:
38
39 MD5HashAlgorithm();
40
41 public:
42
43 String name() const override { return "MD5"; }
44 Int32 hashSize() const override { return 16; }
45
46 public:
47
48 void computeHash(ByteConstArrayView input, ByteArray& output) override;
49 void computeHash64(Span<const Byte> input, ByteArray& output) override;
50 void computeHash64(Span<const std::byte> input, ByteArray& output) override;
51};
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56} // namespace Arcane
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
60
61#endif
Interface of a hashing algorithm.
String name() const override
Name of the algorithm.
Int32 hashSize() const override
Size (in bytes) of the hash key.
View of an array of elements of type T.
Definition Span.h:635
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Array< Byte > ByteArray
Dynamic one-dimensional array of characters.
Definition UtilsTypes.h:121
ConstArrayView< Byte > ByteConstArrayView
C equivalent of a 1D array of characters.
Definition UtilsTypes.h:476
std::int32_t Int32
Signed integer type of 32 bits.