?? captcha_non_gd.php
字號:
*/ function png_chunk($length, $type, $data) { $raw = $type . $data; return pack('N', $length) . $raw . pack('N', crc32($raw)); } /** * Creates greyscale 8bit png - The PNG spec can be found at * http://www.libpng.org/pub/png/spec/PNG-Contents.html we use * png because it's a fully recognised open standard and supported * by practically all modern browsers and OSs */ function create_png($raw_image, $width, $height) { // SIG $image = pack('C8', 137, 80, 78, 71, 13, 10, 26, 10); // IHDR $raw = pack('N2', $width, $height); $raw .= pack('C5', 8, 0, 0, 0, 0); $image .= $this->png_chunk(13, 'IHDR', $raw); // IDAT if (@extension_loaded('zlib')) { $raw_image = gzcompress($raw_image); $length = strlen($raw_image); } else { // The total length of this image, uncompressed, is just a calculation of pixels $length = ($width + 1) * $height; // Adler-32 hash generation // Note: The hash is _backwards_ so we must reverse it if (@extension_loaded('hash')) { $adler_hash = strrev(hash('adler32', $raw_image, true)); } else if (@extension_loaded('mhash')) { $adler_hash = strrev(mhash(MHASH_ADLER32, $raw_image)); } else { // Optimized Adler-32 loop ported from the GNU Classpath project $temp_length = $length; $s1 = 1; $s2 = $index = 0; while ($temp_length > 0) { // We can defer the modulo operation: // s1 maximally grows from 65521 to 65521 + 255 * 3800 // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 $substract_value = ($temp_length < 3800) ? $temp_length : 3800; $temp_length -= $substract_value; while (--$substract_value >= 0) { $s1 += ord($raw_image[$index]); $s2 += $s1; $index++; }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -