[RELEASE]Massive CRC32 calculator

Results 1 to 3 of 3
  1. #1
    Proficient Member Nekroido is offline
    MemberRank
    Mar 2007 Join Date
    『サイレンLocation
    185Posts

    [RELEASE]Massive CRC32 calculator

    Create any folder u like, create file named "index.php" and paste this code.

    NOTE: It calculates CRC32 of every file, it doesn't unpack MRS-files, so u have to unpack them manually.

    PHP Code:
    <?PHP

    header
    ("Content-type: text/plain");

    $d opendir('.');
    $sub_dirs = Array();

    while(
    false !== ($_entry readdir($d)))
    {
        if(!
    is_dir($_entry) && !eregi("\.log$"$_entry) && !eregi("\.php$"$_entry))
        {
            
    $data file_get_contents($_entry);
            
    $crc  str_pad(dechex(crc32($data)), 8'0'STR_PAD_LEFT);

            print
    "    <FILE NAME=\"" $_entry "\" CRC32=\"$crc\"/>\n";
        }
        elseif(
    is_dir($_entry) && !eregi("\.\."$_entry) && !eregi("\."$_entry))
        {
            
    $sub_dirs[] = $_entry;
        }
    }

    while(
    count($sub_dirs) >0)
    {
        
    $dir array_shift($sub_dirs);
        
    $d opendir($dir);

        while(
    $_entry readdir($d))
        {
            if(!
    is_dir($dir '/'$_entry) && !eregi("\.log$"$_entry) && !eregi("\.php$"$_entry))
            {
                
    $data file_get_contents($dir '/'$_entry);
                
    $crc  str_pad(dechex(crc32($data)), 8'0'STR_PAD_LEFT);
                print
    "    <FILE NAME=\"" $dir '/'$_entry "\" CRC32=\"$crc\"/>\n";
            }
            elseif(
    is_dir($dir '/'$_entry) && ($_entry != '..') && ($_entry != '.'))
            {
                
    $sub_dirs[] = $dir '/'$_entry;
            }
        }
    }

    closedir($d);

    ?>
    PS: I love PHP. So I make lots of PHP-programs for some basic automations. %)


  2. #2
    Account Upgraded | Title Enabled! RepublicOfAstra is offline
    MemberRank
    Dec 2006 Join Date
    1,122Posts

    Re: [RELEASE]Massive CRC32 calculator

    Not bad. I like it :)

  3. #3
    Account Upgraded | Title Enabled! kochon is offline
    MemberRank
    Nov 2006 Join Date
    MontrealLocation
    1,451Posts

    Re: [RELEASE]Massive CRC32 calculator

    how should i use this?



Advertisement