1e41f4b71Sopenharmony_ci# crypto_digest.h
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## Overview
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ciProvides APIs for message digest (MD) algorithms.
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci**Library**: libohcrypto.z.so
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Security.CryptoFramework
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ci**Since**: 12
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ci**Related module**: [CryptoDigestApi](_crypto_digest_api.md)
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci## Summary
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci### Types
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci| Name | Description | 
23e41f4b71Sopenharmony_ci| -------- | -------- |
24e41f4b71Sopenharmony_ci| typedef struct [OH_CryptoDigest](_crypto_digest_api.md#oh_cryptodigest) [OH_CryptoDigest](_crypto_digest_api.md#oh_cryptodigest) | Defines an MD. | 
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci### Functions
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci| Name | Description | 
30e41f4b71Sopenharmony_ci| -------- | -------- |
31e41f4b71Sopenharmony_ci| [OH_Crypto_ErrCode](_crypto_common_api.md#oh_crypto_errcode) [OH_CryptoDigest_Create](_crypto_digest_api.md#oh_cryptodigest_create) (const char \*algoName, [OH_CryptoDigest](_crypto_digest_api.md#oh_cryptodigest) \*\*ctx) | Creates an MD instance based on the given algorithm name. | 
32e41f4b71Sopenharmony_ci| [OH_Crypto_ErrCode](_crypto_common_api.md#oh_crypto_errcode) [OH_CryptoDigest_Update](_crypto_digest_api.md#oh_cryptodigest_update) ([OH_CryptoDigest](_crypto_digest_api.md#oh_cryptodigest) \*ctx, [Crypto_DataBlob](_crypto___data_blob.md) \*in) | Updates the data used for generating an MD. | 
33e41f4b71Sopenharmony_ci| [OH_Crypto_ErrCode](_crypto_common_api.md#oh_crypto_errcode) [OH_CryptoDigest_Final](_crypto_digest_api.md#oh_cryptodigest_final) ([OH_CryptoDigest](_crypto_digest_api.md#oh_cryptodigest) \*ctx, [Crypto_DataBlob](_crypto___data_blob.md) \*out) | Generates an MD. | 
34e41f4b71Sopenharmony_ci| uint32_t [OH_CryptoDigest_GetLength](_crypto_digest_api.md#oh_cryptodigest_getlength) ([OH_CryptoDigest](_crypto_digest_api.md#oh_cryptodigest) \*ctx) | Obtains the length of an MD. | 
35e41f4b71Sopenharmony_ci| const char \* [OH_CryptoDigest_GetAlgoName](_crypto_digest_api.md#oh_cryptodigest_getalgoname) ([OH_CryptoDigest](_crypto_digest_api.md#oh_cryptodigest) \*ctx) | Obtains the digest algorithm. | 
36e41f4b71Sopenharmony_ci| void [OH_DigestCrypto_Destroy](_crypto_digest_api.md#oh_digestcrypto_destroy) ([OH_CryptoDigest](_crypto_digest_api.md#oh_cryptodigest) \*ctx) | Destroys an MD instance. | 
37