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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:43:55+00:00 2026-06-14T04:43:55+00:00

Could someone help to understand how it works in python (2.7.3 version)? for,example there

  • 0

Could someone help to understand how it works in python (2.7.3 version)?

for,example there are two hex strings

a='5f70a65ac'
b='58e7e5c36'

how can I xor it properly?

I tried use something like that hex (0x5f0x70 ^ 0x580xe70), but it doesn’t work

  • 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-06-14T04:43:56+00:00Added an answer on June 14, 2026 at 4:43 am

    Convert the strings to integers before trying to do math on them, then back to string afterward.

    print "%x" % (int(a, 16) ^ int(b, 16))
    

    I’m using % here to convert back to string rather than hex() because hex() adds 0x to the beginning (and L to the end if the value is a long integer). You can strip those off, but easier just to not generate them in the first place.

    You could also just write them as hex literals in the first place:

    a=0x5f70a65ac
    b=0x58e7e5c36
    print "%x" % (a ^ b)
    

    However, if you’re reading them from a file or getting them from a user or whatever, the first approach is what you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone help me understand the primitive accessors with this example : i don't
Could someone help me understand why this link works perfectly in firefox but in
I'm new to Flex. Could someone help me understand how Flex generally works with
Im starting to understand how Magento Event Observers work and hoping someone could help
Please could someone help me understand why the div.fl element shown in Developer Tools
I was hoping someone could help me understand the syntax of blocks when used
Hi Could someone please help me to understand how to layout table cell's components
Could someone help me understand the following pheudocode? countWords(vertex, word, missingLetters) k=firstCharacter(word) if isEmpty(word)
Could someone help me to add A-atype B-btype C-ctype ONLY as a legend to
Could someone help me to write a function that checks if a string is

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.