0
Can you make a number smaller without losing data?
if we have a number of about 100 digits can we make it anumber of about 10 or 20 digits or something smaller by using some algorithm with a condition that we can get back the long number from the small number without losing data. i think it us something like hashing but the difference is that we can get the firist number again. sorry for my English :-/
5 Answers
+ 4
@Meru Mario Egie, Thanks for sharing : )
+ 3
Excuse me, but which type of numeric data can support 100 digits?
@Meru Mario Egie, how do we get original value after it is hashed by MD5? also how hex2bin can reduce a number's digit count? I would like to know, please tell me...
+ 1
in PHP Md5($variable) hashes $variable, and we can use md5 on the hashed variable to get the original value!
Also see hex2bin() php
+ 1
hex2bin â Decodes a hexadecimally encoded binary string
the binary string can be very long but will be decided to an hexadecimal string. And if it's useful here I don't really know because the question isn't clear but I thought it was worth looking up.
Md5() is used in password hashing mostly. practical example:
$pass = Solo1earn ;//user input
$pass = md5($pass); //this gives a large binary data and is what u store in the database
but the user doesn't know this! he logs in with same Solo1earn, and though we can't directly unhash the saved password we can hash the user input and compare if they are equivalent.
and if we prove that A=C and B=A then B=C is true.
+ 1
sure Ipang