minigame-std
    Preparing search index...

    Function sha256

    • 计算数据的 SHA-256 哈希值。

      Parameters

      • data: DataSource

        需要计算哈希的数据,可以是字符串或 BufferSource。

      Returns AsyncIOResult<string>

      返回十六进制格式的哈希字符串。

      1.0.0

      const hash = await sha256('Hello, World!');
      if (hash.isOk()) {
      console.log(hash.unwrap()); // 十六进制哈希字符串
      }