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 7186059
In Process

The Archive Base Latest Questions

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

I have (3) md5sums that I need to combine into a single hash. The

  • 0

I have (3) md5sums that I need to combine into a single hash. The new hash should be 32-characters, but is case-sensitive and can be any letter or number. What’s the best way to do this in Python?

  • 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-28T18:33:10+00:00Added an answer on May 28, 2026 at 6:33 pm

    I would start by combinind the md5 hashes into a single hash. You can use SHA256 since it will contain more bytes in the end:

    >>> import hashlib
    >>> combined = hashlib.sha256()
    >>> combined.update(hashlib.md5('test1').digest())
    >>> combined.update(hashlib.md5('test2').digest())
    >>> combined.update(hashlib.md5('test3').digest())
    

    Then you can use base64 to encode it using letters, numbers, and a few extra symbols:

    >>> import base64
    >>> base64.b64encode(combined.digest())
    'PeFC3irNFx8fuzwjAz+fE/up9cz6xujs2Z06IH2GdUM='
    

    If you want just 32 characters long, slice off the last bits:

    >>> base64.b64encode(combined.digest())[:32]
    'PeFC3irNFx8fuzwjAz+fE/up9cz6xujs'
    

    This can contain + and / in addition to letters and numbers like your OP suggests. If you want to replace them, you can use the second parameter to b64encode:

    >>> base64.b64encode(combined.digest(), altchars="AA")[:32]
    'PeFC3irNFx8fuzwjAzAfEAup9cz6xujs'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a python script that logs into a website (in this case, it's
Have a network location that shows paths in the 8.3 short format. I need
I have a list of files, which need to be read, in chunks, into
Have a query that should hopefully be nice and simple to answer. I have
I have a file that I need to reload in my application everytime it
Have an app that can use tts to read text messages. It can also
Have read a lot of articles, but can't make animate function to run indefinitely.
Simplest case: You want to make a text file which says The MD5 hash
have been using no DOCTYPE but rather simply starting with <html> as per HTML5
I am new to databases. I have two sqlite3 databases of same size. I

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.