Microsoft Azure Storage Client Library for C++  7.5.0
The Microsoft Azure Storage Client Library for C++ is a library for working with the Azure Storage Services in C++.
Public Member Functions | List of all members
azure::storage::checksum Class Reference

Represents a checksum to verify the integrity of data during transport. More...

Public Member Functions

 checksum ()
 Initializes a new instance of the azure::storage::checksum class without specifying any checksum method. More...
 
 checksum (utility::string_t md5)
 Initializes a new instance of the azure::storage::checksum class with MD5 hash value. More...
 
 checksum (const utility::char_t *md5)
 Initializes a new instance of the azure::storage::checksum class with MD5 hash value. More...
 
 checksum (uint64_t crc64)
 Initializes a new instance of the azure::storage::checksum class with CRC64 error-detecting code. More...
 
 checksum (checksum_none_t type)
 Initializes a new instance of the azure::storage::checksum class without specifying any checksum method. More...
 
 checksum (checksum_md5_t type, utility::string_t val)
 Initializes a new instance of the azure::storage::checksum class with MD5 hash value. More...
 
 checksum (checksum_sha256_t type, utility::string_t val)
 Initializes a new instance of the azure::storage::checksum class with SHA-256 hash value. More...
 
 checksum (checksum_crc64_t type, uint64_t val)
 Initializes a new instance of the azure::storage::checksum class with CRC64 error-detecting code. More...
 
 checksum (checksum_hmac_sha256_t type, utility::string_t val)
 Initializes a new instance of the azure::storage::checksum class with HMAC-SHA256 authentication code. More...
 
bool is_md5 () const
 Indicates whether this is an MD5 checksum. More...
 
bool is_sha256 () const
 Indicates whether this is an SHA-256 checksum. More...
 
bool is_hmac_sha256 () const
 Indicates whether this is an HMAC-SHA256 authentication code. More...
 
bool is_crc64 () const
 Indicates whether this is a CRC64 checksum. More...
 
bool empty () const
 Indicates whether any checksum method is used. More...
 
const utility::string_t & md5 () const
 Gets the MD5 checksum. More...
 
const utility::string_t & sha256 () const
 Gets the SHA-256 checksum. More...
 
const utility::string_t & hmac_sha256 () const
 Gets the HMAC-256 authentication code. More...
 
utility::string_t crc64 () const
 Gets the CRC64 error-detecting code. More...
 

Detailed Description

Represents a checksum to verify the integrity of data during transport.

Constructor & Destructor Documentation

◆ checksum() [1/9]

azure::storage::checksum::checksum ( )
inline

Initializes a new instance of the azure::storage::checksum class without specifying any checksum method.

◆ checksum() [2/9]

azure::storage::checksum::checksum ( utility::string_t  md5)
inline

Initializes a new instance of the azure::storage::checksum class with MD5 hash value.

Parameters
md5A string containing base64-encoded MD5.

If the provided string is empty, this class is initialized as if checksum method isn't specified.

◆ checksum() [3/9]

azure::storage::checksum::checksum ( const utility::char_t *  md5)
inline

Initializes a new instance of the azure::storage::checksum class with MD5 hash value.

Parameters
md5A string containing base64-encoded MD5.

If the provided string is empty, this class is initialized as if checksum method isn't specified.

◆ checksum() [4/9]

azure::storage::checksum::checksum ( uint64_t  crc64)
inline

Initializes a new instance of the azure::storage::checksum class with CRC64 error-detecting code.

Parameters
crc64An integer containing CRC64 code.

◆ checksum() [5/9]

azure::storage::checksum::checksum ( checksum_none_t  type)
inline

Initializes a new instance of the azure::storage::checksum class without specifying any checksum method.

◆ checksum() [6/9]

azure::storage::checksum::checksum ( checksum_md5_t  type,
utility::string_t  val 
)
inline

Initializes a new instance of the azure::storage::checksum class with MD5 hash value.

Parameters
typeExplicitly specified checksum type, must be azure::storage::checksum_md5.
valA string containing base64-encoded MD5.

◆ checksum() [7/9]

azure::storage::checksum::checksum ( checksum_sha256_t  type,
utility::string_t  val 
)
inline

Initializes a new instance of the azure::storage::checksum class with SHA-256 hash value.

Parameters
typeExplicitly specified checksum type, must be azure::storage::checksum_sha256.
valA string containing base64-encoded SHA-256.

◆ checksum() [8/9]

azure::storage::checksum::checksum ( checksum_crc64_t  type,
uint64_t  val 
)
inline

Initializes a new instance of the azure::storage::checksum class with CRC64 error-detecting code.

Parameters
typeExplicitly specified checksum type, must be azure::storage::checksum_crc64.
valAn integer containing CRC64 code.

◆ checksum() [9/9]

azure::storage::checksum::checksum ( checksum_hmac_sha256_t  type,
utility::string_t  val 
)
inline

Initializes a new instance of the azure::storage::checksum class with HMAC-SHA256 authentication code.

Parameters
typeExplicitly specified checksum type, must be azure::storage::checksum_hmac_sha256.
valA string containing base64-encoded HMAC-SHA256 authentication code.

Member Function Documentation

◆ crc64()

utility::string_t azure::storage::checksum::crc64 ( ) const
inline

Gets the CRC64 error-detecting code.

Returns
A string containing base64-encoded CRC64 error-detecting code.

◆ empty()

bool azure::storage::checksum::empty ( ) const
inline

Indicates whether any checksum method is used.

Returns
true if no checksum method is used; otherwise, false.

◆ hmac_sha256()

const utility::string_t& azure::storage::checksum::hmac_sha256 ( ) const
inline

Gets the HMAC-256 authentication code.

Returns
A string containing base64-encoded HMAC-256 authentiction code.

◆ is_crc64()

bool azure::storage::checksum::is_crc64 ( ) const
inline

Indicates whether this is a CRC64 checksum.

Returns
true if this is a CRC64 checksum; otherwise, false.

◆ is_hmac_sha256()

bool azure::storage::checksum::is_hmac_sha256 ( ) const
inline

Indicates whether this is an HMAC-SHA256 authentication code.

Returns
true if this is an HMAC-SHA256 authentication code; otherwise, false.

◆ is_md5()

bool azure::storage::checksum::is_md5 ( ) const
inline

Indicates whether this is an MD5 checksum.

Returns
true if this is an MD5 checksum; otherwise, false.

◆ is_sha256()

bool azure::storage::checksum::is_sha256 ( ) const
inline

Indicates whether this is an SHA-256 checksum.

Returns
true if this is an SHA-256 checksum; otherwise, false.

◆ md5()

const utility::string_t& azure::storage::checksum::md5 ( ) const
inline

Gets the MD5 checksum.

Returns
A string containing base64-encoded MD5.

◆ sha256()

const utility::string_t& azure::storage::checksum::sha256 ( ) const
inline

Gets the SHA-256 checksum.

Returns
A string containing base64-encoded SHA-256.