D
Dennis Lee Bieber
You counted them? I didn't bother!
Evidence... As with Dragnet "Just the facts..."
You counted them? I didn't bother!
Ferrous Cranus wrote:
Τη ΤÏίτη, 22 ΙανουαÏίου 2013 6:11:20 μ.μ. UTC+2, ο χÏήστης Chris AngelicoÎγÏαψε:
all of it. You are asking something that is fundamentally
impossible[1]. There simply are not enough numbers to go around.
Fundamentally impossible?Well....
OK: How about this in Perl:
$ cat testMD5.pluse strict;
foreach my $url(qw@ /index.html /about/time.html @){
sub hashit {my $url=shift;my @ltrs=split(//,$url);my $hash = 0;
foreach my $ltr(@ltrs){$hash = ( $hash + ord($ltr)) %10000;
printf "%s: %0.4d\n",$url,$hash
which yields:$ perl testMD5.pl/index.html: 1066/about/time.html: 1547
$ cat clashes.pl
use strict;
foreach my $url(qw@
/public/fails.html
/large/cannot.html
/number/being.html
/hope/already.html
/being/really.html
/index/breath.html
/can/although.html
@){
hashit($url);
}
sub hashit {
my $url=shift;
my @ltrs=split(//,$url);
my $hash = 0;
foreach my $ltr(@ltrs){
$hash = ( $hash + ord($ltr)) %10000;
}
printf "%s: %0.4d\n",$url,$hash
}
$ perl clashes.pl
/public/fails.html: 1743
/large/cannot.html: 1743
/number/being.html: 1743
/hope/already.html: 1743
/being/really.html: 1743
/index/breath.html: 1743
/can/although.html: 1743
Hm, I must be holding it wrong...
Ferrous Cranus wrote:
Τη ΤÏίτη, 22 ΙανουαÏίου 2013 6:11:20 μ.μ. UTC+2, ο χÏήστης Chris AngelicoÎγÏαψε:
all of it. You are asking something that is fundamentally
impossible[1]. There simply are not enough numbers to go around.
Fundamentally impossible?Well....
OK: How about this in Perl:
$ cat testMD5.pluse strict;
foreach my $url(qw@ /index.html /about/time.html @){
sub hashit {my $url=shift;my @ltrs=split(//,$url);my $hash = 0;
foreach my $ltr(@ltrs){$hash = ( $hash + ord($ltr)) %10000;
printf "%s: %0.4d\n",$url,$hash
which yields:$ perl testMD5.pl/index.html: 1066/about/time.html: 1547
$ cat clashes.pl
use strict;
foreach my $url(qw@
/public/fails.html
/large/cannot.html
/number/being.html
/hope/already.html
/being/really.html
/index/breath.html
/can/although.html
@){
hashit($url);
}
sub hashit {
my $url=shift;
my @ltrs=split(//,$url);
my $hash = 0;
foreach my $ltr(@ltrs){
$hash = ( $hash + ord($ltr)) %10000;
}
printf "%s: %0.4d\n",$url,$hash
}
$ perl clashes.pl
/public/fails.html: 1743
/large/cannot.html: 1743
/number/being.html: 1743
/hope/already.html: 1743
/being/really.html: 1743
/index/breath.html: 1743
/can/although.html: 1743
Hm, I must be holding it wrong...
<some perl code>
Using that method ABC.html and CBA.html now have different values
because each letter position's value gets bumped up increasingly from
left to right.
You have run this little "hash" algorithm on a whole bunch of files, say
C:\windows\system32 right? And how many collisions did you get?
You've already rejected using the file path or url as a key because it
could change. Why are you wanting to do this hash based on the file's
path or url anyway?
You have run this little "hash" algorithm on a whole bunch of files, say
C:\windows\system32 right? And how many collisions did you get?
You've already rejected using the file path or url as a key because it
could change. Why are you wanting to do this hash based on the file's
path or url anyway?
If you're referring to the "Τη ΤÏίτη, 22 ΙανουαÏίου 2013 6:23:16 μ.μ.
UTC+2, ο χÏήστης Leonard, Arah ÎγÏαψε", that's Greek.
3) This is a Python-specific resource and that's not even Python code. What next? Javascript? Ada? Fortran? COBOL? 8-bit x86 assembly with minimal comments written in Esperanto?
4) The novelty of the entertainment resulting from this perversity has waned, even for me. The educational aspect to novice programmers has likewise run dry. I've now officially grown bored of your game and am joining everyone else who already has already gotten off of this kiddie ride. Congratulations on beating a dead horse into mince-meat and successfully milking the one-uddered cow until the pale is full. I hope that you enjoyed your meal.
Or to borrow a phrase, "I say GOOD DAY, sir!"
Please can we have CORAL 66 mentioned on the odd occasion.
Pail not pale
Or madam?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.