#! perl -wl
use Digest::SHA 'sha1';
use bytes;
$|=1;

$c="a";

print "Start $c";
$ct=0;
for(;$c ne "aaaaaaaaa";$ct++){
    if($ct==10000*10000){
	print "checkpoint $c";
	$ct=0;
    }
    $original=sha1($c);
    
#    $n=unpack("%32b*",$original);
#    if($n<=45){
#        print "$c $n";
#    }
    $bytes=0;
    $ny=0;
    for(unpack("C*",$original)){
        $bytes++ if ($_==0);
        $ny++ if (($_ & 15)==0);
    }
    if ($bytes>=4||$ny>=10){
            print$c 
    } else {
        $n=unpack("%32b*",$original);
        if($n<=45){
            print "$c $n";
        }}
    $c++;
}

# This software is public domain.
