如何从字符串创建 SHA256 哈希

How to create SHA256 hash from a string

我需要为在 TextBox 中输入的密码创建一个 sha256 散列。我尝试使用 ComputeHash(string) 但它只适用于流。

Dim hash = New System.Security.Cryptography.SHA256Managed().ComputeHash(System.Text.Encoding.UTF8.GetBytes("The-password"))