查看: 325|回复: 0

[文章教程] Powersehll MD5加密函数

[复制链接]
xuanxiao 发表于 2022-7-7 10:14:04 | 显示全部楼层 |阅读模式
  1. #将字符串MD5为大写格式

  2. $someString = "test"
  3. $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
  4. $utf8 = new-object -TypeName System.Text.UTF8Encoding
  5. $hash = [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($someString)))

  6. #to remove hyphens and downcase letters add:
  7. $hash = $hash.ToLower() -replace '-', ''
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号