zoukankan      html  css  js  c++  java
  • MD5加密

     1' ----------------------------------------------------
     2        'The Encrypt method enables Encryt a clean string into hash
     3        '
     4        '加密字符串为hash
     5        '
     6        'SHA512Managed().ComputeHash(dataToHash)
     7        'CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(data1ToHash)
     8        '----------------------------------------------------
     9        Public Shared Function Encrypt(ByVal cleanString As StringAs String
    10            '采用MD5
    11            Dim clearBytes As [Byte]()
    12            clearBytes = New UnicodeEncoding().GetBytes(cleanString)
    13            Dim hashedBytes As [Byte]() = CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(clearBytes)
    14            Dim hashedText As String = BitConverter.ToString(hashedBytes)
    15
    16            '再采用MD5
    17            clearBytes = New UnicodeEncoding().GetBytes(hashedText)
    18            hashedBytes = CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(clearBytes)
    19            hashedText = BitConverter.ToString(hashedBytes)
    20
    21            Return hashedText
    22        End Function
  • 相关阅读:
    怎么认Destsoon标签条件
    PHP将图片转base64格式函数
    修改Discuz!X系列开启防CC攻击,不影响搜索引擎收录
    discuz x3.2简化的搜索框代码
    让Discuz! X3.2 SEO标题里的“-”支持空格
    javascript的常用操作(二)
    Spring MVC中注解的简介
    Spring MVC + Thymeleaf
    Maven建立spring-web项目
    Spring @Autowired使用介绍
  • 原文地址:https://www.cnblogs.com/tiasys/p/441833.html
Copyright © 2011-2022 走看看