# plz help me to do the program

• February 8th, 2014, 02:15 PM
plz help me to do the program
hello..
i need to calculate id=hash(number) xor id.id is string and number is random number.my problem is how to convert my string ex='hello' into equivalent integer,so that i can do xor.I have client and server program.i need to display a gui by using graphical nodes.
• February 8th, 2014, 02:24 PM
aesguitar
Re: plz help me to do the program
Firstly use the [code*][/code] tags when posting code.

Second, remember, a char is a number associated with a letter, if you convert the string to an array of chars, you can xor each letter using the ^ operator.
• February 8th, 2014, 02:27 PM
GregBrannon
Re: plz help me to do the program
Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for newcomers.

Can you use String.hashCode()?
• February 9th, 2014, 02:56 AM
Re: plz help me to do the program
Quote:

Originally Posted by GregBrannon
Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for newcomers.

Can you use String.hashCode()?

hello sir,
I need to develop the below lines...1)message1=Hash(ID) xor number
2)Alias id=Hash(number) xor ID.

I have calculated the hashcode of string(ID) and it works fine,but the second line is i am unable to perform the xor operation between number and string..so can u help me to write the code which reads the normal string like hello and display equivalent number so i can perform xor operation..

--- Update ---

Quote:

Originally Posted by GregBrannon
Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for newcomers.

Can you use String.hashCode()?

hello sir,
I need to develop the below lines...1)message1=Hash(ID) xor number
2)Alias id=Hash(number) xor ID.

I have calculated the hashcode of string(ID) and it works fine,but the second line is i am unable to perform the xor operation between number and string..so can u help me to write the code which reads the normal string like hello and display equivalent number so i can perform xor operation..
• February 9th, 2014, 06:03 AM
Norm
Re: plz help me to do the program
Quote:

string like hello and display equivalent number
Can you give some examples of the numbers that should be displayed for a String?
Will each String have a unique number or are there possible collisions where two Strings can have the same number?
• February 9th, 2014, 07:39 AM