计算文本HasH

哈希被用来确定文本、查找重复的文件内容,以及验证密码

$text="this is the text that you want to convert into a hash"
$stream=[IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes($text))
$hash=Get-FileHash -InputStream $stream -Algorithm SHA1
$stream.Close()
$stream.Dispose()
$hash

输出效果:

  

原文地址:https://www.cnblogs.com/feiyucha/p/10878796.html