subtle.digest(algorithm, data)
版本历史
| 版本 | 变更 |
|---|---|
| v24.7.0 | 现在支持 SHA-3 算法。 |
| v24.7.0 | 现在支持 SHAKE 算法。 |
| v15.0.0 | 新增于: v15.0.0 |
-
algorithm<string> -
data<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
返回:<Promise> 成功后使用 <ArrayBuffer> 完成。
\Returns: <Promise> Fulfills with an <ArrayBuffer> upon success.
此方法使用 algorithm 标识的方法,尝试生成 data 的摘要。如果成功,返回的 promise 将使用包含计算摘要的 <ArrayBuffer> 进行解析。
\Using the method identified by algorithm, this method attempts to
generate a digest of data. If successful, the returned promise is resolved
with an <ArrayBuffer> containing the computed digest.
如果 algorithm 作为 <string> 提供,则它必须是以下之一:
\If algorithm is provided as a <string>, it must be one of:
如果 algorithm 作为 <Object> 提供,则它必须具有值为上述之一的 name 属性。
\If algorithm is provided as an <Object>, it must have a name property
whose value is one of the above.