+ 1
Please decode this :=> a46fe47f78a4859de8313e27424a60a7
4 Answers
+ 10
đđ» đŁđđđ”đŒđ»,
sum=0
a="a46fe47f78a4859de8313e27424a60a7"
for i in range(len(a)-1,0,-1):
sum+=16*i+(int(a[i]) if not a[i].isalpha() else 9+ord(a[i])-96)
print(sum)
All i did is conversion of the above hex string into integer. There are programming languages like python that provide function for this conversion without having to write all that code . For example ,
print(int(a, 16))
+ 2
Sylvie if you run the code i posted in first comment, it gives a very different value than what you get from print(int(a, 16)) so obviously it was wrong that i corrected second time.
And sorry, but i am not into the decoding field. You can open up a new question for that.
+ 1
Sylvie Sorry , but there is a little mistake in calculating the value, here is the correct code for it .
sum+=16**(len(a)-1-i)*(int(a[i]) if not a[i].isalpha() else 9+ord(a[i])-96)
+ 1
First tell its encoding method