Sephy Posted April 16, 2008 Report Share Posted April 16, 2008 (edited) varbut kadam ir gatavs scripts kludu notiekshanai un izlaboshanai ar CRC metodem? Ja nav iedodiet kadu lapu kur paskaidrots kaa shis scripts javeido jo es google atradu tikai prieksh c++.... Edited April 16, 2008 by Sephy Link to comment Share on other sites More sharing options...
andrisp Posted April 16, 2008 Report Share Posted April 16, 2008 http://lv.php.net/crc32 ? Link to comment Share on other sites More sharing options...
bubu Posted April 16, 2008 Report Share Posted April 16, 2008 Ar CRC kļūdas nevar izlabot. CRC ir tikai hešsuma datiem, pēc kuras var noteikt vai dati varbūt ir mainīti - netiek garantēti false negative gadījumu neesamība. Link to comment Share on other sites More sharing options...
Sephy Posted April 17, 2008 Author Report Share Posted April 17, 2008 (edited) Njaa es vakar skatijos un neko kas labo nevar atrast. Ir tikai kas parbauda vai ir kadas kludas, bet taas kludas nelabo. Ir kada laba metode ar kuru var atrast kludas un taas izlabot?! edit: piemeram man ir kautkads word dokuments un saglabashu sev kodu ar kautko lidzigu crc32() failaa. ja velak atklajas kadas nevelamas parmainas vinsh automatiski parmaina to kodu un tadejadi arii manu dokumentu atpakal ;P Edited April 17, 2008 by Sephy Link to comment Share on other sites More sharing options...
andrisp Posted April 17, 2008 Report Share Posted April 17, 2008 Sephy, tu man liekas nesaproti, ko tie hash algoritmi nozīmē un kam tie paredzēti. Tev drīzāk vajag Version controlling sistēmu. Piemēram, Subversion. Link to comment Share on other sites More sharing options...
Sephy Posted April 17, 2008 Author Report Share Posted April 17, 2008 Tev drīzāk vajag Version controlling sistēmu. Piemēram, Subversion. sito var integret majaslapaa?! man tipa vaig parbaudit uploadotos dokumentus?! Link to comment Share on other sites More sharing options...
andrisp Posted April 17, 2008 Report Share Posted April 17, 2008 Varēt jau droši vien var, bet neņemos spriest cik tas būtu sarežģīti. A ko tev īsti vajag ? Salīdzināt vienkārši divus dokumentus ? Vai arī vēl kaut ko ? Link to comment Share on other sites More sharing options...
Sephy Posted April 17, 2008 Author Report Share Posted April 17, 2008 (edited) Ir taka majaslapa kur lietotajs var uplaod kautkadu dokumentu(piemeram word.doc). tad to word doc parveido ar crc32() un noglaba tekst faila! pec tam es uztaisit taka kopiju un noglabat kautkur uz sava servaka(to teksta failu ar kodu). velak varu salidzinat vai tas user fails ir vienads ar to manu kopijas failu(kodu nolasa no vina)(es gan nezinu kapec to user dokumentu kads var izmainit ;D) un ja nav vienads tad ar to kodu uztaisa vienadu.... Edited April 17, 2008 by Sephy Link to comment Share on other sites More sharing options...
andrisp Posted April 17, 2008 Report Share Posted April 17, 2008 Ko nozīmē "uztaisa vienādu" ? Cik saprotu, tad tev vienkārši vajag, lai, ja ir mainījies faila saturs uz servera, tad tas tiktu atjaunots no tavas kopijas ? Nu tad tev nevajag Version controllingu, bet pietiks ar to pašu crc32 vai md5. Link to comment Share on other sites More sharing options...
Sephy Posted April 17, 2008 Author Report Share Posted April 17, 2008 nez es vel padomashu ko man vajag ^^ Link to comment Share on other sites More sharing options...
Sephy Posted April 17, 2008 Author Report Share Posted April 17, 2008 (edited) izdomaju vajag luk sho http://en.wikipedia.org/wiki/Hamming_code vai http://en.wikipedia.org/wiki/Reed-Solomon_code kaa php scriptu mana faila parbaudei ^^ Edited April 17, 2008 by Sephy Link to comment Share on other sites More sharing options...
andrisp Posted April 17, 2008 Report Share Posted April 17, 2008 Man gan liekas, ka tu tagad mēģini celt vairāk nekā spēj. Link to comment Share on other sites More sharing options...
Sephy Posted April 17, 2008 Author Report Share Posted April 17, 2008 taa jau arii ir ;P Link to comment Share on other sites More sharing options...
bubu Posted April 17, 2008 Report Share Posted April 17, 2008 Tak vienkārši kopē uploadotos failus atsevišķos folderos un salīdzini ar usera failiem. Ja nesakrīt tad velc ārā nobekapoto failu un miers. Nevajag tev nekādus hamminga kodus. Link to comment Share on other sites More sharing options...
Sephy Posted April 17, 2008 Author Report Share Posted April 17, 2008 (edited) nwm atrisinaju savas problemas ar sito: <?php $chkfilename = "myfile.xxx"; $chkmd5return = md5_file($chkfilename); if ($chkmd5return != "myfile.xxx's md5 value") { echo "You have replaced myfile.xxx with an unknown version of the file, please replace the original file."; } else { (your code to be executed, now that it has confirmed your myfile.xxx has been unmodified) } ?> useris pats vainigs ka maina failus ;D. varbut velak izdomashu kaa ((echo "You have replaced myfile.xxx with an unknown version of the file, please replace the original file.";)) vietaa uzlikt automatiski orginalo failu ;P. man tieshi bija vajadzigs lai ja usera fails neatbilst mana faila kodam tad visnh automatiksi nomainaas.... Edited April 17, 2008 by Sephy Link to comment Share on other sites More sharing options...
Recommended Posts