Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
HashFactory.h
Go to the documentation of this file.
1 //===-- serialbox/core/hash/HashFactory.h -------------------------------------------*- C++ -*-===//
2 //
3 // S E R I A L B O X
4 //
5 // This file is distributed under terms of BSD license.
6 // See LICENSE.txt for more information
7 //
8 //===------------------------------------------------------------------------------------------===//
9 //
13 //===------------------------------------------------------------------------------------------===//
14 
15 #ifndef SERIALBOX_CORE_HASH_HASHFACTORY_H
16 #define SERIALBOX_CORE_HASH_HASHFACTORY_H
17 
19 #include <memory>
20 #include <vector>
21 
22 namespace serialbox {
23 
27 class HashFactory {
28  HashFactory() = delete;
29 
30 public:
37  static std::unique_ptr<Hash> create(const std::string& name);
38 
40  static std::vector<std::string> registeredHashes();
41 
43  static std::string defaultHash();
44 };
45 
46 } // namespace serialbox
47 
48 #endif
static std::string defaultHash()
Get the default hash algorithm (currently MD5 if avialable, SHA256 otherwise)
Definition: HashFactory.cpp:46
static std::unique_ptr< Hash > create(const std::string &name)
Construct an instance of the Hash name
Definition: HashFactory.cpp:26
Namespace of the serialbox library.
Definition: Archive.h:25
Factory to create Hash algorithms.
Definition: HashFactory.h:27
static std::vector< std::string > registeredHashes()
Get a vector of strings of the registered hashes.
Definition: HashFactory.cpp:41