subtle.digest(algorithm, data)
algorithm: <string> | <Object>data: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>- 返回:<Promise> 以 <ArrayBuffer> 完成
使用由 algorithm 指定的方法,subtle.digest() 会尝试生成 data 的摘要。如果成功,返回的 Promise 将被解析为一个包含计算得出的摘要的 <ArrayBuffer>。
【Using the method identified by algorithm, subtle.digest() 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:】
'SHA-1''SHA-256''SHA-384''SHA-512'
如果 algorithm 作为 <Object> 提供,它必须有一个 name 属性,其值必须是上述之一。
【If algorithm is provided as an <Object>, it must have a name property
whose value is one of the above.】