mounkuls Posted April 18, 2008 Report Posted April 18, 2008 man vispaar nevajag parveidot visu 1337 uz 01001000101 bet gan sitaa 1=0 3=1 3=1 7=0 Negribi paskaidrot?
Sephy Posted April 21, 2008 Author Report Posted April 21, 2008 laikam nepariezi izskaidroju ko man vajag ;D. man isteniba vienkarshi vajadzeja parveidot skaitlus binari piemeram 7 uz 111 vai 10 uz 1010...
andrisp Posted April 21, 2008 Report Posted April 21, 2008 (edited) nu bet to jau decbin() dara! Edited April 21, 2008 by andrisp
Sephy Posted April 21, 2008 Author Report Posted April 21, 2008 paldies to jau es sapratu ;D. starp citu vai tas taa domats ka crc32 ja parveido failu ar vinu dod priekshaa minus zimi?! nevar kautkaa uzlikt lai ir tikai ar +??
bubu Posted April 21, 2008 Report Posted April 21, 2008 crc32 nav nekāda sakara ar mīnuszīmēm. Tas atgriež pilnu 32-bitīgu integeri, ar kuru tu tālāk vari darīt, kas vien tev ietīkas.
Sephy Posted April 21, 2008 Author Report Posted April 21, 2008 crc32 nav nekāda sakara ar mīnuszīmēm. Tas atgriež pilnu 32-bitīgu integeri, ar kuru tu tālāk vari darīt, kas vien tev ietīkas. hmm paskaties kaut vai shadu piemeru: <?php $ciparz = "13337"; $parveidotais = crc32($ciparz); echo "parveidots ar crc32 $parveidotais"; ?> ja izvada to parveidoto vismaz man sanak -771315054. un man tas minus neparak patik ;P
andrisp Posted April 21, 2008 Report Posted April 21, 2008 Manuāli vajag rūpīgāk lasīt: Because PHP's integer type is signed, and many crc32 checksums will result in negative integers, you need to use the "%u" formatter of sprintf() or printf() to get the string representation of the unsigned crc32 checksum.
Sephy Posted April 21, 2008 Author Report Posted April 21, 2008 tad tur sanak pavisam cits skaitlis :P. nevis tas pats skaitlis bez minusa oO
Recommended Posts