Solved

How to convert an Unsigned int32 value to 8 byte long hex value.

Posted on 2012-03-27
3
532 Views
Last Modified: 2012-03-27
I have a unsigned int32 value in variable in c# and i need to convert it into 8 byte long hexadecimal value how can i do this
0
Comment
Question by:ziorinfo
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 180 total points
ID: 37775014
UInt32 val = 12316667;
var data = val.ToString("X");

Open in new window

0
 

Author Comment

by:ziorinfo
ID: 37775031
will it give me 8 byte long hex value always ?
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37775038
depends on your input, if length is less than 8 bytes add required number of 0 bytes to it to make it 8 bytes...
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question