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
  • 相关阅读:
    初试 Elastic Search
    索引分类
    Nginx
    LINQ入门
    CSS学习
    Keras 安装
    火车进站
    2016年网易笔试编程题2
    Java GC
    linux 安装 mysql
  • 原文地址:https://www.cnblogs.com/tiasys/p/441833.html
Copyright © 2011-2022 走看看