Wat ik heb gedaan is een programmatje geinstalleerd. De eerste keer dat ik het draaide binnen excel crashte excel wel, dus hou daar even rekening mee. Daarna geen probleem meer gehad.
http://www.cryptosys.net/hash.html#download
Daar is het programma te vinden installeer het op je computer zodat je een hash functie in excel kan aanroepen. (Bij de eerste keer krijg je te zien dat je niet hebt betaald en bij mij crashte hij dus op dat scherm)
Vervolgens moet je via ALT F11 even je vba editor openen. Hier zet je de functies in die nodig zijn om het dll bestandje aan te roepen.
Nu heb je wat code nodig. Die code heb ik hieronder gezet. Zet in je A kolom alle dingen onder elkaar die je gehashed wil hebben en in je B kolom komen je resultaten. Start hiervoor de macro genaamd maak_SHA
Option Explicit
' SECURE HASH ALGORITHM 1 (SHA-1) HASH FUNCTION
Public Declare Function SHA1_StringHexHash Lib "diCrHash" _
(ByVal sDigest As String, ByVal sMessage As String) As Long
Public Declare Function SHA1_FileHexHash Lib "diCrHash" _
(ByVal sDigest As String, ByVal sFilename As String, ByVal sMode As String) As Long
Public Declare Function SHA1_BytesHexHash Lib "diCrHash" _
(ByVal sDigest As String, ByRef aByteArray As Byte, ByVal lngLength As Long) As Long
Public Declare Function SHA1_BytesHash Lib "diCrHash" _
(ByRef aDigest As Byte, ByRef aByteArray As Byte, ByVal lngLength As Long) As Long
Public Declare Function SHA1_Init Lib "diCrHash" () As Long
Public Declare Function SHA1_AddString Lib "diCrHash" _
(ByVal hContext As Long, ByVal sMessage As String) As Long
Public Declare Function SHA1_AddBytes Lib "diCrHash" _
(ByVal hContext As Long, ByRef aByteArray As Byte, ByVal lngLength As Long) As Long
Public Declare Function SHA1_HexDigest Lib "diCrHash" _
(ByVal sDigest As String, ByVal hContext As Long) As Long
Public Declare Function SHA1_Reset Lib "diCrHash" _
(ByVal hContext As Long) As Long
Public Declare Function SHA1_Hmac Lib "diCrHash" _
(ByVal sDigest As String, ByRef aByteArray As Byte, ByVal lngLength As Long, _
aKeyArray As Any, ByVal lngKeyLen As Long) As Long
Public Function returnSHA(invoer As String) As String
Dim iRet As Long
Dim sDigest As String
Dim hContext As Long
hContext = SHA1_Reset(hContext)
' Set context handle
hContext = SHA1_Init()
' Remember to check for an invalid handle
If hContext = 0 Then
MsgBox "Failed to set context"
Exit Function
End If
iRet = SHA1_AddString(hContext, invoer)
' Set sDigest to be 40 chars
sDigest = String(40, " ")
iRet = SHA1_HexDigest(sDigest, hContext)
returnSHA = sDigest
End Function
Sub maak_SHA()
Range("A1").Select
While ActiveCell.Value <> ""
ActiveCell.Offset(0, 1).Value = returnSHA(ActiveCell.Value)
ActiveCell.Offset(1, 0).Select
Wend
End Sub