|
Aktualizr
C++ SOTA Client
|
The Hash class The hash of a file or Uptane metadata. More...
#include <types.h>
Public Types | |
| enum | Type { kSha256, kSha512, kUnknownAlgorithm } |
Public Member Functions | |
| Hash (const std::string &type, const std::string &hash) | |
| Hash (Type type, const std::string &hash) | |
| bool | HaveAlgorithm () const |
| bool | operator== (const Hash &other) const |
| bool | operator!= (const Hash &other) const |
| std::string | TypeString () const |
| Type | type () const |
| std::string | HashString () const |
Static Public Member Functions | |
| static Hash | generate (Type type, const std::string &data) |
| static std::string | TypeString (Type type) |
| static std::string | encodeVector (const std::vector< Hash > &hashes) |
| static std::vector< Hash > | decodeVector (std::string hashes_str) |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Hash &h) |
The Hash class The hash of a file or Uptane metadata.
File hashes/checksums in Uptane include the length of the object, in order to defeat infinite download attacks.
1.8.13