Skip to content

interface HashExtensions

cangjie
public interface HashExtensions

功能:定义字符串摘要计算扩展能力。

扩展到

  • String

成员概览

成员功能
func sha256()计算字符串的 SHA-256 摘要并返回 Base64 编码结果。
func sha384()计算字符串的 SHA-384 摘要并返回 Base64 编码结果。
func sha512()计算字符串的 SHA-512 摘要并返回 Base64 编码结果。

func sha256()

cangjie
func sha256(): String

功能:计算字符串的 SHA-256 摘要并返回 Base64 编码结果。

返回值:

  • String - 返回 SHA-256 摘要的 Base64 字符串。

func sha384()

cangjie
func sha384(): String

功能:计算字符串的 SHA-384 摘要并返回 Base64 编码结果。

返回值:

  • String - 返回 SHA-384 摘要的 Base64 字符串。

func sha512()

cangjie
func sha512(): String

功能:计算字符串的 SHA-512 摘要并返回 Base64 编码结果。

返回值:

  • String - 返回 SHA-512 摘要的 Base64 字符串。