Jump to content

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.

I don't know if something like this will work but always worth ago:

 

<?php

$hashthis = "jghie81fjme019";
echo shuffle('$hashthis');

?>

 

I don't even know if that even works. but worth a try. shuffle the random letters and numbers up some how i'd say.

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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.