Python Forum
Convert even byte array to odd
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert even byte array to odd
#1
Hello, my question is as follows:
Say I have a 256-bit array, e.g.

'74ccc1643dd3d97236bc74d378692f9617f779e6d935a6df9e8d2fe161b1fed4'
This represents a large number which is even. I want to convert this to an odd number as efficiently as possible.
My intuition is that XORing the Least Significant bit of this would be the most efficient way.
How can I do this?
Reply


Messages In This Thread
Convert even byte array to odd - by medatib531 - Mar-17-2020, 02:18 AM
RE: Convert even byte array to odd - by scidam - Mar-17-2020, 02:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert numpy array to image without loading it into RAM. DreamingInsanity 7 6,033 Feb-08-2024, 09:38 AM
Last Post: paul18fr
  Convert np Array A to networkx G IanAnderson 2 732 Jul-05-2023, 11:42 AM
Last Post: IanAnderson
  extract only text strip byte array Pir8Radio 7 3,105 Nov-29-2022, 10:24 PM
Last Post: Pir8Radio
  Convert String of an int array to a Numpy array of ints mdsousa 5 5,797 Apr-08-2021, 08:00 PM
Last Post: mdsousa
  'utf-8' codec can't decode byte 0xe2 in position 122031: invalid continuation byte tienttt 12 11,797 Sep-18-2020, 10:10 PM
Last Post: tienttt
  convert array of numbers to byte array adetheheat 3 2,865 Aug-13-2020, 05:09 PM
Last Post: bowlofred
  'utf-8' codec can't decode byte 0xda in position 184: invalid continuation byte karkas 8 31,887 Feb-08-2020, 06:58 PM
Last Post: karkas
  convert a json file to a python dictionnary of array Reims 2 2,306 Sep-10-2019, 01:08 PM
Last Post: Reims
  Byte array is sorted when sending via USB daviddlc68 1 2,876 Aug-16-2019, 10:11 AM
Last Post: wavic
  Reading data from serial port as byte array vlad93 1 12,187 May-18-2019, 05:26 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020