Arcane  v3.16.0.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
MD5HashAlgorithm.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* Calcule la fonction de hashage MD5. */
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/*!
29 * \brief Calcule la fonction de hashage MD5 d'un tableau.
30 *
31 * Pour cet algorithme, la taille de la clé est de 16 octets.
32 */
33class ARCANE_UTILS_EXPORT MD5HashAlgorithm
34: public IHashAlgorithm
35{
36 public:
37
38 MD5HashAlgorithm();
39
40 public:
41
42 String name() const override { return "MD5"; }
43 Int32 hashSize() const override { return 16; }
44
45 public:
46
47 void computeHash(ByteConstArrayView input, ByteArray& output) override;
48 void computeHash64(Span<const Byte> input, ByteArray& output) override;
49 void computeHash64(Span<const std::byte> input, ByteArray& output) override;
50};
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
55} // namespace Arcane
56
57/*---------------------------------------------------------------------------*/
58/*---------------------------------------------------------------------------*/
59
60#endif
Interface d'un algorithme de hashage.
String name() const override
Nom de l'algorithme.
Int32 hashSize() const override
Taille (en octet) de la clé de hash.
Vue d'un tableau d'éléments de type T.
Definition Span.h:513
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Array< Byte > ByteArray
Tableau dynamique à une dimension de caractères.
Definition UtilsTypes.h:208
ConstArrayView< Byte > ByteConstArrayView
Equivalent C d'un tableau à une dimension de caractères.
Definition UtilsTypes.h:563
std::int32_t Int32
Type entier signé sur 32 bits.