Jump to content

[SOLVED] Crazy Md5 Hashing...


phpSensei

Recommended Posts

if you mean a reversible hash, you're wasting your time - anything that you can reverse, someone else is likely to be able to do as well.  hashes are often used by comparison, not by actually reversing the algorithm to obtain the input.

 

if you still want to, think of ANYTHING you want to perform to a string.  run a length count, do some math to it (that has unambiguous inverse functions), process back out into a random string, and cut it off / lengthen it to reach a set length.  just remember the operations and their order, and you should (theoretically - rounding could be a very big source of error in something like this) return to the original parameter.

 

perhaps you could be more specific about what you're trying to do.

it won't work.  shuffle() expects an array, and if it DID take strings, it would be shuffling "$hashthis", not the value of $hashthis itself as you're using single quotes.

 

furthermore, this would be useless as a hashing method, as the algorithm is randomized - you could feed it two of the exact same array and get different output.  how would one compare the results with any degree of confidence that you're actually evaluating their equality?

usually it is a hash that they store in the database.  generally speaking, i doubt they use a chopped version of an MD5, as this could easily lead to collisions (unless one was to check the database first, to ensure that it's unique).  chances are it's just a random string they create for each file, without bothering with a hash.

 

EDIT:  it's only different in the number of characters that are rendered in the end.

KK, I did this...

 

WAIT< Why Should I? Joking Lollerrr...

 

I just took the filename than put it in a variable....then..

 

.


<?php 


$filename1=$_FILE['name'];

$md5= md5($filename1);

$arr2 = str_split($md5, 6);

$new_file_name= $filename . "_" . $arr2;

INSERT INTO CRAP

?>


 

i dONT KNOW IF THAT MADE SENSE

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.