⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 captcha_non_gd.php

📁 这些都是我以前学习是用到的源码
💻 PHP
📖 第 1 页 / 共 5 页
字号:
	* of the given length adding the relevant crc	*/	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 + -