计算SHA1哈希算法的Powershell V2.0

编程入门 行业动态 更新时间:2024-10-26 18:29:09
本文介绍了计算SHA1哈希算法的Powershell V2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有谁知道是否可以计算SHA1哈希在PowerShell中V2.0?

Does anyone know if it is possible to calculate a SHA1 Hash in Powershell V2.0?

唯一的信息,我可以在网上找到的是使用PowerShell V4.0。

The only information I can find online is with Powershell V4.0.

推荐答案

我不记得在PowerShell的V2天,.NET 3.5是典型的安装了。我认为这是这样的。

I can't remember back in Powershell V2 days, .NET 3.5 was typically installed too. I think it's the case.

您可以尝试以下,看看它的工作原理:

You can always try the following and see if it works:

$file = 'd:\scripts\sha1.ps1' $sha1 = New-Object System.Security.Cryptography.SHA1CryptoServiceProvider [System.BitConverter]::ToString( $sha1.ComputeHash([System.IO.File]::ReadAllBytes($file)))

替换 $文件中的值和你有一个文件名。

Replace the value of $file with the name of a file you have.

更多推荐

计算SHA1哈希算法的Powershell V2.0

本文发布于:2023-11-30 10:14:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649615.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:算法   Powershell

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!