A hashing algorithm

Status
Not open for further replies.

FRNC

Beta member
Messages
1
I'm a novice, not a programmer. I've come across a problem I need help with that a programmer would be the most likely person to be able to solve. Can someone please use the following procedure to "hash" the following number sequence:

545372491


Algorithm for hashing

1) Strip leading digit
2) Group remaining 8 digits into two groups of 4 digits
3) Shift first group one digit to the right, wrapping around
4) Shift second group two digits to the right, wrapping around
5) Represent resulting values in hexadecimal form
(For example 8419 would be represented as 1000010000011001)
6) XOR the two values giving a 4-digit hex result

What is meant by: 6) XOR the two values giving a 4-digit hex result????
 
which one is leading digit? 5 or 1?

XOR means you get "one" when only one of the two operants is turned on. like:

1011010
XOR
1001111
=
0010101
then convert the binary to hex.

"3) Shift first group one digit to the right, wrapping around "
IS it one digit to the right or one bit to the right?
Does wrapping around mean something like this:
4537 shift 1 digit to the right wrapping around
=7453?
 
Status
Not open for further replies.
Back
Top Bottom