hex

Increment a Hex value (JAVA)

Hi, can you increment a hex value in Java? i.e. "hex value" = "hex value"++ ...

VB6: Surely this simple Hex addition is wrong?

I'm getting odd results in some VB6 code which I've narrowed to this: Debug.Print Hex(&hEDB80000 + &h8300) Shows EDB78300 That can't by right can it? Surely it should be EDB88300? Am I going mad? ...

Help me translate long value, expressed in hex, back in to a date/time

I have a date value, which I'm told is 8 bytes, a single "long" (aka int64) value, and converted to hex: 60f347d15798c901 How can I convert this and values like this, using PHP, into a time/date? Converting it to decimal gives me: 96 243 71 209 87 152 201 1 A little more info: the original value is a C# DateTime, and should repres...

How do I sha1 hash hex values correctly in PHP?

I have a series of hex bytes. Theoretically, the last 20 bytes are the sha1 hash of the first part: 3F F4 E5 25 98 20 52 70 01 63 00 68 00 75 00 79 00 69 00 00 00 74 28 96 10 09 9D C9 01 00 74 A0 D7 DB 0B 9D C9 01 4D 00 79 00 47 00 72 00 6F 00 75 00 70 00 00 00 2F 00 00 00 BD 0D EA 71 BE 0B 25 75 E7 5C 58 20 31 57 F3 9A EF 69 1B FD If...

C# byte[] to hex string

How do i convert a byte[] to a string, every time i attempt it i get System.Byte[] instead of the value. Also How do i get the value in Hex instead of a decimal? ...

How does one write the hex values of a char in ASCII to a text file?

Here is what I currently have so far: void WriteHexToFile( std::ofstream &stream, void *ptr, int buflen, char *prefix ) { unsigned char *buf = (unsigned char*)ptr; for( int i = 0; i < buflen; ++i ) { if( i % 16 == 0 ) { stream << prefix; } stream << buf[i] << ' '; } } I've tried doing stream.hex, str...

Background-color hex to JavaScript variable (jQuery)

I'm kind of new to JavaScript and jQuery and now I'm facing a problem: I need to post some data to PHP and one bit of the data needs to be the background color hex of div X. jQuery has the css("background-color") function and with it I can get RGB value of the background into a JavaScript variable. The CSS function seems to return a s...

Hex ANDing in Excel and/or Visual Basic

I'm trying to AND two hex number bit-wise in Excel/Visual Basic. Ex. 53FDBC AND 00FFFF which should yield 00FDBC. Any ideas on how to do this? ...

Algorithm Question: Need to dynamically INCREMENT from 00FF00 to FF0000 over TIME, C#/Java

Hey all, I want to change the color Bright Green to Dark Red over time (240 hours). The best way I can see is to change the hex combo from 00FF00 to FF0000. I don't know how to dynamically count up to FF0000 from 00FF00 for the life of me. I'm looking over a 10 day period, so most likely over 240 hours to increment. Can anyone help ...

C convert hex to decimal format

Hello, Compiling on linux using gcc. I would like to convert this to hex. 10 which would be a. I have managed to do this will the code below. unsigned int index = 10; char index_buff[5] = {0}; sprintf(index_buff, "0x%x", index); data_t.un32Index = port_buff; However, the problem is that I need to assign it to a structure and t...

Binary diff tool?

I need a utility to diff two binary files. The files are large (6-50GB) Beyond Compare is my favorite diff tool, and I own it, but it cannot handle binary files over what can fit in the process's address space. HexDiff 3.0 seemed interesting, except the trial version doesn't do diff's. *rolls eyes* The tool should be free, since I'm ...

Convert number to binary string

Is this the best way to convert a Python number to a hex string? number = 123456789 hex(number)[2:-1].decode('hex') Sometimes it doesn't work and complains about Odd-length string when you do 1234567890. Clarification: I am going from int to hex. Also, I need it to be escaped. IE: 1234567890 -> '\x49\x96\x02\xd2' not '499602D2' ...

hex viewer/editor GUI component for Java Swing?

I'm looking for a decent hex viewer (read-only; I don't need an editor) GUI component that I can use within my Swing GUI. Is there anything out there? I suppose I could write my own, but am hoping to avoid doing this. (also it would be nice to be able to render certain bytes as colorized/bold to highlight particular bytes in question.) ...

DateTime hex format

I have the following know pair of hex values and dates: 7D 92 D2 5C = 26/03/2009 - 09:28 7D 92 DA CC = 27/03/2009 - 11:12 7D 92 E3 56 = 28/03/2009 - 13:22 7D 92 EC 4F = 29/03/2009 - 17:15 7D 92 F3 16 = 30/03/2009 - 12:22 7D 92 FB 1A = 31/03/2009 - 12:26 7D 93 0B 01 = 01/04/2009 - 12:01 7D 93 12 88 = 02/04/2009 - 10:08 7D 93 1A 30 = 03/...

Aesthetic Web Colors

What's a good resource for choosing aesthetically pleasing color combinations and themes? At the moment I'm using a color picker and stealing from various places. It's a hack. ...

Hex To String C#

Hello, I need to check for a string located inside a packet that I receive as byte array.If I use BitConverter.ToString() ,I get the bytes as String with dashes(example 00-50-25-40-A5-FF). I tried most function I found after a quick googling,but most of them have input parameter type string and if I call them with the string with dashes...

How to convert a double to hex?

Hello, How do I convert a ruby float/double to high endian order hex with high bytes and low bytes. EXAMPLE: start with 99.0 end up with 40 58 C0 00 00 00 00 00 high bytes low bytes ...

Escape problem with hex

I need to print escaped characters to a binary file using Ruby. The main problem is that slashes need the whole byte to escape correctly, and I don't know/can't create the byte in such a way. I am creating the hex value with, basically: '\x' + char Where char is some 'hex' value, such as 65. In hex, \x65 is the ASCII character 'e'. ...

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: <dataseries name="ford" color="FF00FF" /> I'm creating these dynamically, so I would like to generate the hex code for each dataseries randomly. What is the best way to do this? ...

Define smallest possible datatype in c++ that can hold six values

I want to define my own datatype that can hold a single one of six possible values in order to learn more about memory management in c++. In numbers, I want to be able to hold 0 through 5. Binary, It would suffice with three bits (101=5), although some (6 and 7) wont be used. The datatype should also consume as little memory as possible....