hashSync(alg:HashAlg, plaintext:string): Uint8Array
消息摘要算法,返回Uint8Array格式密文。
导入模块:
import { aegis } from '@hw-agconnect/petal-aegis'; 参数:
参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
alg | 是 | HASH模式枚举。 | |
plaintext | string | 是 | 明文普通字符串。 |
返回值:
参数 | 类型 | 说明 |
|---|---|---|
字节数组 | Uint8Array | 生成的Uint8Array密文。 |