﻿ Newest 'hex' Questions - Stack Overflow

# Questions tagged [hex]

Hexadecimal (also base 16, or hex) is the base-16 positional numeral system, using the 16 symbols 0–9 and A‒F.

7,570 questions
14 views

I've got a valid mac address in a var called oldMAC I need to increment this and then return a new valid MAC Address. In this example I'm incrementing by 1, but it could be by any value. So far I've ...
20 views

### How to put this in python so it can loop random with the mask?

How would I put this in python so it can loop generate random with mask leading zeros? std::string min = "000000000000000000000000000000000000000000000000000000000000000F"; std::string max = "...
20 views

### What is the use of multiplying a set of bits by 256 when adding hexadecimal values?

I am currently trying to decode a hexadecimal payload to extract values from it. The value to be converted is 0x7608. However, I am not getting the required result which should have been a 16 bit ...
16 views

### Convert huerotation to hexadecimal color

I found this function for huerotation: Change png image color in fabric js Wonderful :-) I get a value like -0.123456 and the t-shirt is blue. Ok, but how can i convert this value into a ...
58 views

### Is it possible to sign signature to HEX?

I am trying to create a digital signature. when i console log this signature i get weird characters like this : 1��N�U]*������gڇ��Xр��ӶhR���1��q My friend is making the backend to check this ...
69 views

### Convert unsigned integer with hexdecimals to string

I have an _u8 Array with hexadecimals in it, in the form of: A81B6A9D4D2E for example. And I want to turn it into an string in the form of: A8-1B-6A-9D-4D-2E and have it as a string to send it. #...
36 views

### How to convert long hex string to BigInt in scala

I have this very long hex string. val hexStr = "...
26 views

### Convert array of hex to array to ASCII (Javascript)

I want to convert this array of hex to array of ASCII. I have tried to convert the array to string and using a function to convert hex string into ASCII, does not meet my expectation. var name = ...
30 views

### How to verify the CRC of a hex Data?

I'm trying to verify a CRC o a giant hex String packet, I have this algorithm that is basically the same algorithm that generates the CRC. I'm passing the hex String packet already with the CRC ...
29 views

### Java - Convert a HEX color to a decimal color

I want to convert a HEX color (Like #FF0000) to a decimal color (Like 16711680). How do I need to do this? I've already tried using the Color class, but I can't find a method for converting the ...
69 views

### How to separate hex string from the string [on hold]

I'm using the snmp-library (https://github.com/soniah/gosnmp) for golang and after SNMP-request it give me the string with some text, example: "120switch type.....bla bla some words or digits" or hex-...
18 views

### Convert Hex (bytes) to ASCII text in Odd-length string

I am trying to write converter that will accept any length Hex (bytes) to ASCII text. This one online works great https://www.rapidtables.com/convert/number/hex-to-ascii.html However when I am ...
17 views

### Regarding a problem with python 3 in hex-string conversion

I have found out a problem with python 3.6.7 when I tried to stringfy a hexadecimal value. The original hexadecimal number in the string is wrongly converted into an acsii letter Ë. Is there any way ...
13 views

### How will we do RGB to HEX conversion with UNIX/Shell code [duplicate]

I have a files with line by line 'RGB' values, I to write Unix/bash code to read the file line by line and generate the 'Hex' values of respective RGB values. I have already tried the same in python, ...
78 views

### How to Convert octal to hexadecimal? [closed]

How to convert octal numbers to hexadecimal and hexadecimal to octal in C language ?
21 views

### Interpret new line character using Hex code

I get row seperator value in one JSON and I use that as a parameter in my code. Problem, When ever the JSON gets populated(By taking data from Database) having row separator as key and value "\n", ...
13 views

### What are the MSB and LSB in given hexa decimal number

I am facing a problem in calculating MSB and LSB in my hexa decimal information 0x6943 inside an ethernet trace and in wireshark it is analysed to have LSB as 0x3 and MSB as 0x0. How is it possible ...
36 views

### One Line of Byte Containing Hex: How to Convert to String

I'm Using Python 3.7.3 on Centos RHEL Fedora. Taking a CSV File which contains lines of byte data. I am able to decode those strings without a problem, except where the line has a "Hex" character. ...
25 views

### How to change the value of EAX to 1 instead of 0

I am trying to change the value of EAX in HEX to 1 from 0. below is a screen shot of the EAX i need changing. However I do not know how to change it to 1 in Hex. In the Registers (FPU) its showing as ...
11 views

### “bincopy.Error: record '?' too short ” while reading the .hex using method bincopy.Binfile() file using Python 3

Unable to read a .hex file using the bincopy module in python 3. The same .hex file can be read using bincopy module in python 2. So, definitely this must not be a problem related to the hex file. ...
36 views

### How to change the value of one hex to another hex in react.js component (Simple ways)

I have a colour A = #9c2aa0 I need a colour B = colour A + 30% black (#000000) transparency appiled inside react components (in pseudo class) url for code : https://imgur.com/a/L7MsNJM
19 views

### How to correctly work with bytes reading in JavaScript? How to correctly select position

I need to read some decimal values from HEX. For example, I have 2-tariffs electicity metering and with LoRa IOT device I read and send 2 integer values 33780 and 6687 (kilowatts) to my server. ...
18 views

### Why can't I convert these hexadecimals into utf-8?

Hexadecimals: 0xe0 0x3e 0x38 0x2e 0x7e 0x63 0x78 0x66 HEX: e0 => DEC: 224 HEX: 3e => DEC: 62 and so on. If I convert each of these hexadecimals to a decimal and look up the decimal in the "unicode ...
19 views

### I read image file as binary strange symbols appear

I read an image file in binary in python: open('chall.png, 'rb').read() Result: b'\xe0>8.~cxfein{ ;-0lek\xf7virejneinv\xe7I\x01blo7\x14"1\x07;\x03\x1bE\x19\x1c\x19\x0f\x1a\x05\x07L\x11\x10\x1e\...
65 views

### perl file to hex number 82?

Trying to do binary to hex conversion on a file. I can output the hex but however when I try to output the result to a file,variable it returns the string "82". I cannot understand why; like all ...
25 views

### Cannot read .blk file C++ (Visual Studios)?

for my project I have a .blk file containing strings of binary data. And I would like to read that file, but I get a blank line when I cout the file. **When I import the .blk file, Visual Studios ...
24 views

### How to print hex in python without converting to int?

I have a hex array and whenever I try to print it , it prints the int value of it my code adds = [0x8048453, 0x8048459, 0x804845b, 0x804845d, 0x8048462, 0x8048465, 0x8048466, 0x8048470, 0x8048476, ...
52 views

### How to decode a hex byte defined as string? [duplicate]

I read a printed byte in a file, as a string: a = "b'\xa0-\xfc\xa3\xf8\xd9'" type(a) is str. How should I decode it? The decoded value should be a02dfca3f8d9. A part the file is uploaded here: ...
68 views

### How to parse int/dec values from old delphi program data file

I need to parse bin data files used by old program written in Delphi (source lost, no executable too). Everything is fine except reading decimal/integer values from it. File contains array of ...
17 views

### Trouble with simple Hex to Int Calculation

The specifications for mp4 files outlines its contained matrix. For which, it describes: The matrix provides a transformation matrix for the video: (u,v,w) are restricted here to (0,0,1) with types (...
15 views

### Convert char to hex VALUE in python 2.7

I'm a bit confused here. I'm trying to timestamp a MIFARE card with python 2.7 What I was trying was to binascii.hexlify(char), but this seems to return a string, which made the whole timestamp ...
62 views

### Shortening the Hex number by removing leading zeros in Java

I have Hex number available in string and I want to shorten it by removing leading zeros. I need to do it in Java For example : 0000000000000000000000000A000000 -> 0x0A000000 ...
36 views

### Strictly convert string to int [closed]

I am trying to store a hexadecimal string value : ex "3958ABBFEC23BD40" to uint64 which would like this: fmt.Println(myuint64) \$ 0x3958ABBFEC23BD40 I have tried using encoding/hex, or strconv to ...
15 views

### Parse and split a hexadecimal bytearray in python

I would like to parse and split a hexadecimal bytearray read from the vehicle CAN. The entire 64 bits were read as bytearray(b'\xa0\xc6\xa6\xc2\x06\xe3)B'), and I would like to split it based on bit ...
16 views

### Soft question - Memory address of the last byte allocated of an array

The variable int A[10] is allocated from the HEX address DDDD04BA. I would like to find the HEX address of the last byte allocated of the array. Why we subtract 1 from: DDDD04BA+28=DDDD04E2, DDDD04E2-...
35 views

### Efficient way to convert HEX string into int in pyspark [duplicate]

Is there an efficient way to convert a StringType() column with hexadecimal numbers (0-9, A-F) to 10 based int like LongType() in pyspark? I can achieve this by pandas_udf like: @F.pandas_udf('long')...
27 views

### Python 3: Unable to convert ASCII String to Hexadecimal

Python Version: 3.7.2 I need to convert a string in ASCII like Øâþ  ÿþ !Zk2ìm "Ï"À>q úÞ to Hexademical, which in this case would be d8 e2 02 12 02 fe 01 20 9b 10 20 20 03 ff 07 fe 20 20 21 5a ...
63 views

### How to bit shift hex value using Golang?

Let's say I have a string with the value of 4ADDF6C259EBAFF8. Using this I want to get a timestamp, using the formula (hex(val) >> 25) + 1008000400. Using t he encoding/hex package, I have ...
17 views

### While converting Hexadecimal to ASCII characters I am getting Boxes and unrecognized Symbols

When I am Converting Hexadecimal Numbers to their ASCII Characters some are coming in boxes with numbers and question marks sort of. I want them to be converted in ASCII Characters. I have tried ...
27 views

### Java Spring: How convert HTML character codes in hex format from textarea to plain text?

I have web application writed in React JS and Java Spring boot. In my Board Component I have form with textarea and button. While debugging when I click on button I am redirect to PostMapping in ...
33 views

### tcl string map exact values

I have a converted hex string which I'm wanting to replace. Hello %user and %user2 I am wanting to replace %user and %user2 with the populated variable result in this case, Willma and Fred. Where I ...
18 views

### How to Send Data from android via wifi to device that connected to that wifi router?

Hi guys i want to send some hex codes to an device that connected to router in some way and i create an android application that can connect that wifi and send data to special ip and port but when i ...
75 views

### Hexdecimal to String Convert - Ruby

I'm trying to convert hexadecimal to string using Ruby and it does not work with some Chinese characters. I am new to Ruby. Current code is working fine with non-Chinese characters but now code ...
37 views

### Wrong value returned when converting from raw character to hex equivalent

I have an application where the input is a raw set of bytes and I want to see the two-digit hex code of each of those bytes. For now I'm trying to get the proper hex code for one byte. This is my code:...
32 views

### How to convert 16bit hexadecimal and binary representations to decimal float (and vice versa) in python?

I am working on a problem which requires me to convert hexadecimal and binary FP16 representation of float numbers to decimal float. I also need to convert decimal float numbers to FP16 hexadecimal ...
28 views

### Converting csv read hex string values to uint8_t in c++

So I am currently able to read some hex values from a csv file using ifstream. I am able to read the values and assign them to a string variable. But I want to convert them to uint8_t values. So ...
17 views

### Transmitting hex code through Arduino Leonardo by USART to device

I am trying to send a hex command to a device with an Arduino Leonardo, that also accepts commands through a Bluetooth interface. Basically I am trying to switch a laser on and off through hex ...
38 views

### Get first three bits from a byte

My question is simple, i need to convert the first three bits of a byte to a integer (Enum) value. However the things i try i always get a 0 back. This is wat the document says: Bit 0-3: These bits ...