+ Reply to Thread
Results 1 to 7 of 7

Creating an MD5 function

  1. #1
    Registered User
    Join Date
    05-29-2017
    Location
    United States
    MS-Off Ver
    Excel 2016 (16.0.7329.1054) 64-Bit
    Posts
    2

    Creating an MD5 function

    I need a function that can MD5 hash a string. This is what I have so far:

    Please Login or Register  to view this content.


    However, this is giving me the wrong hash. Does anyone know what the problem might be?
    Last edited by alansidman; 05-29-2017 at 06:47 PM. Reason: Wrong code

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Creating an MD5 function

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Creating an MD5 function

    By using VBA automatic data conversion, from string to array of bytes, like :
    Please Login or Register  to view this content.
    the result (array of bytes), is in unicode format (2 bytes for each character).

    You have to to discard every even bytes (only take the odd bytes), like this :


    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  4. #4
    Registered User
    Join Date
    05-29-2017
    Location
    United States
    MS-Off Ver
    Excel 2016 (16.0.7329.1054) 64-Bit
    Posts
    2

    Re: Creating an MD5 function

    This worked perfectly, thank you!

  5. #5
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Creating an MD5 function

    You are welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  6. #6
    Registered User
    Join Date
    10-18-2017
    Location
    China
    MS-Off Ver
    O365
    Posts
    1

    Re: Creating an MD5 function

    Anyone can share a 32 bit MD5 function? Thanks

  7. #7
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,616

    Re: Creating an MD5 function

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Last edited by Kaper; 10-18-2017 at 06:00 AM.
    Best Regards,

    Kaper

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating Mod Function
    By anstar in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 07-18-2014, 02:51 PM
  2. [SOLVED] Creating Function in VBA
    By bmbalamurali in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-18-2014, 11:27 AM
  3. Help on creating a if function or a nested if function????
    By noob_excel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-08-2012, 12:39 AM
  4. Creating a function to simplify a more complex function
    By mk74 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-29-2011, 08:43 AM
  5. Creating an IF function with VB
    By Tracer123 in forum Excel General
    Replies: 4
    Last Post: 05-23-2008, 09:59 PM
  6. Creating a Macros function but co9ntent of function only works in a sub plz help
    By Alexandre Brisebois (www.pointnetsolutions.com) in forum Excel General
    Replies: 6
    Last Post: 07-20-2005, 04:05 PM
  7. [SOLVED] Creating a Function
    By teresa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-06-2005, 10:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1