Codulle - L'explorateur de code sources

Accueil>> AlBulle >> Albulle1.0rc3 >> themes >> albulle >> images >> ie

Informations fichier

Nom du fichier : OMcrc32.php
Taille du fichier : 2 Ko (73 lignes)
Language : PHP

  1. span style="color: #808080; font-style: italic;">/*
  2. * CRC32 calculation for big files : avoids loading whole file in RAM
  3. *
  4. * Author/Copyright : Olivier MATHERET
  5. * matheret@free.fr http://matheret.free.fr
  6. * Licenced under CeCILL2
  7. *
  8. * Based on :
  9. * Reverse CRC adapted from "Reversing CRC – Theory and Practice"
  10. * HU Berlin Public Report
  11. * Martin Stigge, Henryk Plotz, Wolf Muller, Jens-Peter Redlich
  12. *
  13. */
  14. /**
  15. * Gives 4 bytes so that it afterwards will compute to the given crc
  16. *
  17. * This function uses the method of the multiplication with (x^N)^ -1.
  18. */// calculate crc except for the last 4 bytes ; this is essentially crc32 ()*/
  19. $crcreg = 0xffffffff ;
  20.  
  21. // calculate new content bits
  22. // new_content = tcrcreg * CRCINV mod CRCPOLY
  23. // reduce modulo CRCPOLY
  24. // add CRCINV if corresponding bit of operand is set
  25. // return new content
  26. $buffer = ""/* Calculates the CRC32 of the given file without loading the file in RAM at once */'rb'""

Liste des projets

Téléchargez Codulle

Publié par Codulle - v0.1.1 - © Bubulles Creations