Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7195331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:33:28+00:00 2026-05-28T20:33:28+00:00

How can you create an md5 hash for a string on a mac using

  • 0

How can you create an md5 hash for a string on a mac using bash? md5sum does not exist in my environment. I did a man for md5 but I’m confused about what that really does.

md5 "string"

does not return a hash.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:33:29+00:00Added an answer on May 28, 2026 at 8:33 pm

    This should work –

    [jaypal:~/Temp] echo "this will be hashed" | md5
    2caf9daf910b5ef86796f74c20b7e0b
    

    or if you prefer here string notation then –

    [jaypal:~/Temp] md5 <<< 'this will be hashed'
    55be2dc2df2c1cc7bad72a0ecb338841
    

    UPDATE:

    Per the man page, you can play around with any of the following options

    [jaypal:~/Temp] man md5
    MD5(1)           General Commands Manual           MD5(1)
    ...
    NAME
         md5 – calculate a message-digest fingerprint (checksum) for a file
    -s string
            Print a checksum of the given string.
    
    -p      Echo stdin to stdout and append the checksum to stdout.
    
    -q      Quiet mode - only the checksum is printed out.  Overrides the -r option.
    ...
    
    [jaypal:~/Temp] md5 -s 'this will be encrypted'
    MD5 ("this will be encrypted") = 502810f799de274ff7840a1549cd028a
    
    [jaypal:~/Temp] md5 -qs 'this will be encrypted'
    502810f799de274ff7840a1549cd028a
    

    Note: MD5 always produces the same hash. The reason you find the output different from the example given above is due to a point that has been made in the comments. The first two examples use the trailing newline character to produce the hash. To avoid that, you can use:

    [jaypal:~/Temp] echo -n "this will be encrypted" | md5
    502810f799de274ff7840a1549cd028a
    

    For example, if you use echo -n "string" | md5 (note the -n option), you get b45cffe084dd3d20d928bee85e7b0f21. But, if you use echo "string" | md5, you get b80fa55b1234f1935cea559d9efbc39a.

    Or, verify it with the shell:

    ➜  [jaypal:~/Temp] [ $(echo "HOLA" | md5) = $(echo "HOLA" -n | md5) ]; echo "$?"
    1
    # 1 -> False. Hence, the result from echoing "HOLA" toggling the -n flag
    # outputs different md5 checksums.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a md5 hash for a string but the problem
Using C#, I want to create an MD5 hash of a text file. How
I'm looking to create an ID system for cataloging images. I can't use md5()
I can create the following and reference it using area[0].states[0] area[0].cities[0] var area =
I can create a contact that is not mail enabled, but how do I
I can create a sparse php array (or map) using the command: $myarray =
Possible Duplicate: How come MD5 hash values are not reversible? I was reading a
I am trying to create an md5 value in php using the instruction given.
I want to create a random string (token) which can be used to identify
In python, given a really large file (~700MB), how can I create an md5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.