Answer the question
In order to leave comments, you need to log in
Can the last 3 characters of md5 be repeated?
Good afternoon.
$sol = 'MMMddFF';
echo md5(time().$sol);
Answer the question
In order to leave comments, you need to log in
$start = time();
$count = 100000;
$sol = 'MMMddFF';
$last = $start;
$s = substr(md5($start.$sol), 32-3);
echo('Last: '.$s.' at '.$start);
for ($i=$start+1; $i<$start+$count; $i++) {
$cs = substr(md5($i.$sol), 32-3);
if ($s == $cs) {
echo(', '.$i.' ('.($i-$last).')');
$last = $i;
}
}
What's the difference if it's md5 or something else? You take only 3 characters. That's a total of 16 ( [a-f0-9]
) different meanings for each character.
16^3 = 4096.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question