Share via

Excel Hash Function/plugins

Anonymous
2016-04-23T08:09:58+00:00

Hello,

Can someone guide me onto how to calculate hash functions of values in excel?

I would like to find out about plugins mainly or anything that calculates the hash offline, on the computer.

Also, the more hash functions it supports, the better.

Online related hash calculations are also appreciated.

Thank you millions!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2016-04-24T09:07:31+00:00

    if B4's value was POTATO, then the hash would be 0718efaf8b438e839194f164a83581519f3de4022d355f124b15b5f1aede6b25854c498f55776eca930647f1a82707f4782f2aa6538e25e07a3b9b8a0a9f17d5

    Option Explicit

    Private Sub Example_SHA512()

      Debug.Print SHA512("POTATO")

    End Sub

    Function SHA512(ByVal S As String) As String

      'https://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512managed.aspx

      Static UTF8 As Object, SHA As Object

      Dim Data, Temp, i As Long

      If SHA Is Nothing Then

        Set UTF8 = CreateObject("System.Text.UTF8Encoding")

        Set SHA = CreateObject("System.Security.Cryptography.SHA512Managed")

      End If

      Data = SHA.ComputeHash_2(UTF8.GetBytes_4(S))

      ReDim Temp(LBound(Data) To UBound(Data)) As String

      For i = LBound(Data) To UBound(Data)

        Temp(i) = Right$("0" & Hex(Data(i)), 2)

      Next

      SHA512 = Join(Temp, "")

    End Function

    6 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-04-23T11:13:24+00:00

    Hi. I would like basically to have a function (like =sum(), =average(), etc.) that could be called for calculating hash values for anything stored inside a cell.

    e.g. for =sha512(B4).

    if B4's value was POTATO, then the hash would be

    0718efaf8b438e839194f164a83581519f3de4022d355f124b15b5f1aede6b25854c498f55776eca930647f1a82707f4782f2aa6538e25e07a3b9b8a0a9f17d5

    If it is possible by vb code, can you link me to some references? ( I would like the hash to be calculated offline, on the PC. Is this possible?)

    1 person found this answer helpful.
    0 comments No comments
  3. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2016-04-23T10:58:17+00:00

    anything that calculates the hash offline, on the computer.

    Calculate hash with which hash function for what purpose?

    Hash codes are calculated in general of byte arrays... so I don't believe that you'll find an AddIn for Excel... but you can find vb codes for hash functions on the web...

    Andreas.

    0 comments No comments