未验证 提交 17687831 编写于 作者: O openharmony_ci 提交者: Gitee

!15314 [翻译完成】#I6E35F (仅涉及代码和格式更改)

Merge pull request !15314 from Annie_wang/cherry-pick-1677569792
...@@ -60,9 +60,9 @@ Calculates a hash value for a file. This API uses a promise to return the result ...@@ -60,9 +60,9 @@ Calculates a hash value for a file. This API uses a promise to return the result
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | -------------------------- | | --------------------- | -------------------------- |
| Promise<string> | Promise used to return the hash value. The hash value is a hexadecimal string consisting of digits and uppercase letters.| | Promise<string> | Promise used to return the hash value. The hash value is a hexadecimal string consisting of digits and uppercase letters.|
**Example** **Example**
...@@ -93,6 +93,7 @@ Calculates a hash value for a file. This API uses an asynchronous callback to re ...@@ -93,6 +93,7 @@ Calculates a hash value for a file. This API uses an asynchronous callback to re
**Example** **Example**
```js ```js
let filePath = pathDir + "/test.txt";
Hash.hash(filePath, "sha256", (err, str) => { Hash.hash(filePath, "sha256", (err, str) => {
if (err) { if (err) {
console.info("calculate file hash failed with error message: " + err.message + ", error code: " + err.code); console.info("calculate file hash failed with error message: " + err.message + ", error code: " + err.code);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册