473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

HEX Operations in C#

I ran into this ridiculous problem while working on a checksum problem.

I currently have a string containing the HEX values of a checksum.
Is there any way in .net to perform AND operations on two HEX values?

I need to AND my result with 7F.
Jun 26 '08 #1
5 5405
RedSon
5,000 Expert 4TB
Does the bitwise "and" operator not work for you?
Jun 26 '08 #2
nmsreddi
366 256MB
Hello

i too have done some thing like this , i never find direct operation on Hex values

i am converting my complete values to binary values then i am applying my logic there .

Hope may help you too.

Regards
nmsreddi
Jun 27 '08 #3
Plater
7,872 Expert 4TB
Int.Parse() can be overloaded to accept HEX values
(e.g. int.Parse("2A") will give you 42)
You can typecast to a byte do your AND operations like that?
Jun 27 '08 #4
RedSon
5,000 Expert 4TB
Int.Parse() can be overloaded to accept HEX values
(e.g. int.Parse("2A") will give you 42)
You can typecast to a byte do your AND operations like that?
You cant do?

Expand|Select|Wrap|Line Numbers
  1. int x;
  2. x = 0x7F & 0xA;
In this case x would be 137 or in hex 89 or in binary 10001001?
Jun 27 '08 #5
Plater
7,872 Expert 4TB
You cant do?

Expand|Select|Wrap|Line Numbers
  1. int x;
  2. x = 0x7F & 0xA;
In this case x would be 137 or in hex 89 or in binary 10001001?
You can, but if you have a string like this "A3 D7 22 3E FA" you would need some sort of automated system.
Jun 27 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Leslaw Bieniasz | last post by:
Cracow, 20.09.2004 Hello, I need to implement a library containing a hierarchy of classes together with some binary operations on objects. To fix attention, let me assume that it is a...
3
by: Scott Brady Drummonds | last post by:
Hello, all, My most recent assignment has me working on a medium- to large-sized Windows-based C++ software project. My background is entirely on UNIX systems, where it appears that most of my...
3
by: ThunderMusic | last post by:
Hi, I have 2 UInt64 to add and then divide the result by another value. How can I do this? because the math operators have not been defined for UInt64. Can somebody help please? Thanks ...
17
by: Chad Myers | last post by:
I've been perf testing an application of mine and I've noticed that there are a lot (and I mean A LOT -- megabytes and megabytes of 'em) System.String instances being created. I've done some...
13
by: Immanuel Goldstein | last post by:
Obtained under the Freedom of Information Act by the National Security Archive at George Washington University and posted on the Web today, the 74-page "Information Operations Roadmap" admits that...
36
by: mrby | last post by:
Hi, Does anyone know of any link which describes the (relative) performance of all kinds of C operations? e.g: how fast is "add" comparing with "multiplication" on a typical machine. Thanks!...
3
by: Hallvard B Furuseth | last post by:
I'm wondering how to design this: An API to let a request/response LDAP server be configured so a user-defined Python module can handle and/or modify some or all incoming operations, and later...
6
by: carsonbj | last post by:
I have an issue where the below operation works on a little-endian architecture but not on a big-endian architecture. I was under the impression that pointer arithmetic is architecture independant...
4
by: alex | last post by:
hi friends ... i am facing a problem while detecting floating point operations in my project, please help me. i want to find out the places in my C/C++ project where i am doing floating...
0
by: tabassumpatil | last post by:
Please send the c code for: 1.STACK OPERATIONS : Transfer the names stored in stack s1 to stack s2 and print the contents of stack s2. 2.QUEUE OPERATIONS : Write a program to implement...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.