tagged [hex]

How do I get the STX character of hex 02

How do I get the STX character of hex 02 I have a device to which I'm trying to connect via a socket, and according to the manual, I need the "STX character of hex 02". How can I do this using C#?

12 Jan at 18:48

How to create python bytes object from long hex string?

How to create python bytes object from long hex string? I have a long sequence of hex digits in a string, such as > 000000000000484240FA063DE5D0B744ADBED63A81FAEA390000C8428640A43D5005BD44 only much l...

14 Jan at 17:42

C# Convert Char to Byte (Hex representation)

C# Convert Char to Byte (Hex representation) This seems to be an easy problem but i can't figure out. I need to convert this character in byte(hex representation), but if i use ``` byte b = Convert.To...

31 Mar at 21:25

How to convert a byte array to a hex string in Java?

How to convert a byte array to a hex string in Java? I have a byte array filled with hex numbers and printing it the easy way is pretty pointless because there are many unprintable elements. What I ne...

2 May at 19:55

Python Hexadecimal

Python Hexadecimal How to convert decimal to hex in the following format (at least two digits, zero-padded, without an 0x prefix)? Input: `255` Output:`ff` Input: `2` Output: `02` I tried `hex(int...

8 May at 20:23

Convert from string ascii to string Hex

Convert from string ascii to string Hex Suppose I have this string I need a function that convert this string to this string: I searched online and found a lot of similar things, but not an answer to...

10 Apr at 08:31

Java Convert integer to hex integer

Java Convert integer to hex integer I'm trying to convert a number from an integer into an another integer which, if printed in hex, would look the same as the original integer. For example: Convert 2...

17 Feb at 01:8

printf() formatting for hexadecimal

printf() formatting for hexadecimal Why, when printing a number in hexadecimal as an 8 digit number with leading zeros, does `%#08X` display the same result as `0x%08X`? When I try to use the former, ...

26 Apr at 12:23

Convert a "big" Hex number (string format) to a decimal number (string format) without BigInteger Class

Convert a "big" Hex number (string format) to a decimal number (string format) without BigInteger Class How to convert a "big" Hex number (in string format): > EC851A69B8ACD843164E10CFF70CF9E86DC2FEE3...

18 Oct at 16:28

Declaring a hex constant in VB.NET

Declaring a hex constant in VB.NET How can I convert the following C# hexadecimal into a [VB.NET](http://en.wikipedia.org/wiki/Visual_Basic_.NET) hexadecimal? I tried the following, but it doesn't wor...

8 Jan at 17:12

Convert bytes to bits in python

Convert bytes to bits in python I am working with Python3.2. I need to take a hex stream as an input and parse it at bit-level. So I used `bytes.fromhex(input_str)` to convert the string to actual byt...

11 Jan at 07:23

String.Format for Hex

String.Format for Hex With below code, the colorsting always gives #DDDD. Green, Red and Space values int he How to fix this?

27 Nov at 22:28

Convert decimal to hexadecimal in UNIX shell script

Convert decimal to hexadecimal in UNIX shell script In a UNIX shell script, what can I use to convert decimal numbers into hexadecimal? I thought od would do the trick, but it's not realizing I'm feed...

2 May at 12:13

BigInteger to Hexadecimal

BigInteger to Hexadecimal Quick question... I have a stupidly long `BigInteger` which I would like to write to a file as a hex string. I know Java provides the `.toString(16)` method which does this, ...

21 Nov at 06:43

How to get a Color from hexadecimal Color String

How to get a Color from hexadecimal Color String I'd like to use a color from an hexa string such as `"#FFFF0000"` to (say) change the background color of a Layout. `Color.HSVToColor` looks like a win...

17 Jul at 10:35

What is 0x10 in decimal?

What is 0x10 in decimal? I have the following code: `SN` is a string so this should give the 5th Char. Ok! Now I have another code but: `SN.get_Chars(0x10)` I wonder what 0x10 is? Is it a number? If i...

31 Dec at 19:43

How do I create a random hex string that represents a color?

How do I create a random hex string that represents a color? I'm generating some charts that need a hex string for the colors. Example: I'm creating these dynamically, so I would like to generate the ...

4 May at 20:14

Convert double into hex in C#

Convert double into hex in C# I have this value: I would like to convert it to HEX and print the HEX to the console. I have already converted a string and int into their respective HEX values, but a d...

31 Jan at 13:34

How do I get the color from a hexadecimal color code using .NET?

How do I get the color from a hexadecimal color code using .NET? How can I get a color from a hexadecimal color code (e.g. `#FFDFD991`)? I am reading a file and am getting a hexadecimal color code. I ...

22 Sep at 06:18

C# Build hexadecimal notation string

C# Build hexadecimal notation string How do I build an escape sequence string in hexadecimal notation. Example: I want to be able to build strings with hex-values between 00 to FF like this (in this e...

7 Nov at 01:45

How to convert an int to a hex string?

How to convert an int to a hex string? I want to take an integer (that will be

22 Jul at 13:54

How to create a hex dump of file containing only the hex characters without spaces in bash?

How to create a hex dump of file containing only the hex characters without spaces in bash? How do I create an hex dump of a binary file in Linux using bash? The `od` and `hexdump` commands both inser...

17 Apr at 05:21

What's the correct way to convert bytes to a hex string in Python 3?

What's the correct way to convert bytes to a hex string in Python 3? What's the correct way to convert bytes to a hex string in Python 3? I see claims of a `bytes.hex` method, `bytes.decode` codecs, a...

29 Sep at 14:16

Xamarin.Forms.Color to hex value

Xamarin.Forms.Color to hex value I have a Xamarin.Forms.Color and I want to convert it to a 'hex value'. So far, I haven't found a solution to my problem. My code is as follows: ``` foreach (var cell ...

18 Aug at 18:56

Write bytes to file

Write bytes to file I have a hexadecimal string (e.g `0CFE9E69271557822FE715A8B3E564BE`) and I want to write it to a file as bytes. For example, How can I accomplish this using .NET and C#?

18 Jun at 20:41