100+ results for 'php hexdec'

Not the results you expected?

UuidValidator.php (https://gitlab.com/luchoman08/personal_collection_mv) PHP · 249 lines

1 <?php

2

3 /*

240 // & 0b1100 (12)

241 // = 0b1000 (8)

242 if ((hexdec($value{self::STRICT_VARIANT_POSITION}) & 12) !== 8) {

243 $this->context->buildViolation($constraint->message)

244 ->setParameter('{{ value }}', $this->formatValue($value))

Abstract.php (https://github.com/lamminpaa/iBooker.git) PHP · 389 lines

1 <?php

2 /**

3 * Zend Framework

166 $this->_module_size = array($value,$value);

167 }else{

168 require_once 'Zend/Matrixcode/Exception.php';

169 throw new Zend_Matrixcode_Exception(

170 'Invalid module size'

194 {

195 if (preg_match('`\#[0-9A-Fa-f]{6}`', $value)) {

196 $this->_fr_color = hexdec($value);

197 } elseif (is_numeric($value) && $value >= 0 && $value <= 16777125) {

198 $this->_fr_color = intval($value);

199 } else {

200 require_once 'Zend/Matrixcode/Exception.php';

201 throw new Zend_Matrixcode_Exception(

202 'Fore color must be set as #[0-9A-Fa-f]{6}'

color.php (https://gitlab.com/OnBlox/OnBlox-Template) PHP · 306 lines

1 <?php

2 /**

3 * File containing the ezcGraphColor class

120 {

121 $key = $keys[$nr];

122 $color->$key = hexdec( $hexValue ) % 256;

123 }

124 }

Bcmath.php (https://github.com/MontmereLimited/ZendFramework-v1.git) PHP · 203 lines

1 <?php

2 /**

3 * Zend Framework

18 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

19 * @license http://framework.zend.com/license/new-bsd New BSD License

20 * @version $Id: Bcmath.php 23775 2011-03-01 17:25:24Z ralph $

21 */

22

24 * @see Zend_Crypt_Math_BigInteger_Interface

25 */

26 // // // // // // // // // // require_once 'Zend/Crypt/Math/BigInteger/Interface.php';

27

28 /**

29 * Support for arbitrary precision mathematics in PHP.

30 *

31 * Zend_Crypt_Math_BigInteger_Bcmath is a wrapper across the PHP BCMath

ref.math.html (https://bitbucket.org/thncr/manuals.git) HTML · 411 lines

10 <div class="next" style="text-align: right; float: right;"><a href="function.abs.html">abs</a></div>

11 <div class="up"><a href="book.math.html">Math</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

13 </div><hr /><div id="ref.math" class="reference">

14 <h1 class="title">Math 函数</h1>

402

403

404 <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="function.abs.html">abs</a> — 绝对值</li><li><a href="function.acos.html">acos</a> — 反余弦</li><li><a href="function.acosh.html">acosh</a> — 反双曲余弦</li><li><a href="function.asin.html">asin</a> — 反正弦</li><li><a href="function.asinh.html">asinh</a> — 反双曲正弦</li><li><a href="function.atan2.html">atan2</a> — 两个参数的反正切</li><li><a href="function.atan.html">atan</a> — 反正切</li><li><a href="function.atanh.html">atanh</a> — 反双曲正切</li><li><a href="function.base-convert.html">base_convert</a> — 在任意进制之间转换数字</li><li><a href="function.bindec.html">bindec</a> — 二进制转换为十进制</li><li><a href="function.ceil.html">ceil</a> — 进一法取整</li><li><a href="function.cos.html">cos</a> — 余弦</li><li><a href="function.cosh.html">cosh</a> — 双曲余弦</li><li><a href="function.decbin.html">decbin</a> — 十进制转换为二进制</li><li><a href="function.dechex.html">dechex</a> — 十进制转换为十六进制</li><li><a href="function.decoct.html">decoct</a> — 十进制转换为八进制</li><li><a href="function.deg2rad.html">deg2rad</a> — 将角度转换为弧度</li><li><a href="function.exp.html">exp</a> — 计算 e 的指数</li><li><a href="function.expm1.html">expm1</a> — 返回 exp(number) - 1,甚至当 number 的值接近零也能计算出准确结果</li><li><a href="function.floor.html">floor</a> — 舍去法取整</li><li><a href="function.fmod.html">fmod</a> — 返回除法的浮点数余数</li><li><a href="function.getrandmax.html">getrandmax</a> — 显示随机数最大的可能值</li><li><a href="function.hexdec.html">hexdec</a> — 十六进制转换为十进制</li><li><a href="function.hypot.html">hypot</a> — 计算一直角三角形的斜边长度</li><li><a href="function.is-finite.html">is_finite</a> — 判断是否为有限值</li><li><a href="function.is-infinite.html">is_infinite</a> — 判断是否为无限值</li><li><a href="function.is-nan.html">is_nan</a> — 判断是否为合法数值</li><li><a href="function.lcg-value.html">lcg_value</a> — 组合线性同余发生器</li><li><a href="function.log10.html">log10</a> — 以 10 为底的对数</li><li><a href="function.log1p.html">log1p</a> — 返回 log(1 + number),甚至当 number 的值接近零也能计算出准确结果</li><li><a href="function.log.html">log</a> — 自然对数</li><li><a href="function.max.html">max</a> — 找出最大值</li><li><a href="function.min.html">min</a> — 找出最小值</li><li><a href="function.mt-getrandmax.html">mt_getrandmax</a> — 显示随机数的最大可能值</li><li><a href="function.mt-rand.html">mt_rand</a> — 生成更好的随机数</li><li><a href="function.mt-srand.html">mt_srand</a> — 播下一个更好的随机数发生器种子</li><li><a href="function.octdec.html">octdec</a> — 八进制转换为十进制</li><li><a href="function.pi.html">pi</a> — 得到圆周率值</li><li><a href="function.pow.html">pow</a> — 指数表达式</li><li><a href="function.rad2deg.html">rad2deg</a> — 将弧度数转换为相应的角度数</li><li><a href="function.rand.html">rand</a> — 产生一个随机整数</li><li><a href="function.round.html">round</a> — 对浮点数进行四舍五入</li><li><a href="function.sin.html">sin</a> — 正弦</li><li><a href="function.sinh.html">sinh</a> — 双曲正弦</li><li><a href="function.sqrt.html">sqrt</a> — 平方根</li><li><a href="function.srand.html">srand</a> — 播下随机数发生器种子</li><li><a href="function.tan.html">tan</a> — 正切</li><li><a href="function.tanh.html">tanh</a> — 双曲正切</li></ul>

405 </div>

406 <hr /><div class="manualnavbar" style="text-align: center;">

408 <div class="next" style="text-align: right; float: right;"><a href="function.abs.html">abs</a></div>

409 <div class="up"><a href="book.math.html">Math</a></div>

410 <div class="home"><a href="index.html">PHP Manual</a></div>

411 </div></body></html>

412

placeholder.class.php (https://github.com/hustcc/placeholder.js.git) PHP · 357 lines

1 <?php

2 if (strpos(__FILE__, $_SERVER['PHP_SELF'])) { header('HTTP/1.0 403 Forbidden'); exit; }

347 {

348 if (strlen($hex) === 3) {

349 $rgbArray = array(hexdec($hex[0] . $hex[0]), hexdec($hex[1] . $hex[1]), hexdec($hex[2] . $hex[2]));

350 } else if (strlen($hex) === 6) {

351 $rgbArray = array(hexdec($hex[0] . $hex[1]), hexdec($hex[2] . $hex[3]), hexdec($hex[4] . $hex[5]));

IP.php (https://code.google.com/p/alfresco-php-sdk/) PHP · 261 lines

1 <?php

2 /*

3 * Collection of public static functions to play with IP address

42 * Determine if an IP address really is an IP address, and if it is public,

43 * i.e. not RFC 1918 or similar

44 * Comes from ProxyTools.php

45 */

46 public static function isPublic( $ip ) {

114 * Given an IP address in dotted-quad notation, returns an unsigned integer.

115 * Like ip2long() except that it actually works and has a consistent error return value.

116 * Comes from ProxyTools.php

117 * @param $ip Quad dotted IP address.

118 */

252 return $m[1];

253 if ( preg_match( '/^' . RE_IPV6_V4_PREFIX . RE_IPV6_WORD . ':' . RE_IPV6_WORD . '$/i', $addr, $m ) )

254 return long2ip( ( hexdec( $m[1] ) << 16 ) + hexdec( $m[2] ) );

255

256 return null; // give up

Converter.php (https://gitlab.com/imamul68e/137619_PHP31) PHP · 278 lines

1 <?php

2 /**

3 * This file is part of PHPWord - A pure PHP library for reading and writing

4 * word processing documents.

5 *

9 * For the full copyright and license information, please read the LICENSE

10 * file that was distributed with this source code. For the full list of

11 * contributors, visit https://github.com/PHPOffice/PHPWord/contributors.

12 *

13 * @link https://github.com/PHPOffice/PHPWord

16 */

17

18 namespace PhpOffice\PhpWord\Shared;

19

20 /**

class-Shoestrap_Color.php (https://gitlab.com/aristath/shoestrap-3) PHP · 481 lines

1 <?php

2

3

54 $hex = self::sanitize_hex( $hex, false );

55

56 $red = hexdec( substr( $hex, 0, 2 ) );

57 $green = hexdec( substr( $hex, 2, 2 ) );

58 $blue = hexdec( substr( $hex, 4, 2 ) );

59

60 // rgb is an array

113 // returns brightness value from 0 to 255

114

115 $red = hexdec( substr( $hex, 0, 2 ) );

116 $green = hexdec( substr( $hex, 2, 2 ) );

Document.php (https://github.com/henck/rtf-html-php.git) PHP · 336 lines

1 <?php

2

3 declare(strict_types=1);

4

5 namespace RtfHtmlPhp;

6

7 class Document

211 $parameter = $this->char;

212 $this->GetChar();

213 $parameter = hexdec($parameter . $this->char);

214 }

215

GIS_Linestring.class.php (https://bitbucket.org/hrayrpapikyan/stahlbaum.git) PHP · 298 lines

1 <?php

2 /* vim: set expandtab sw=4 ts=4 sts=4: */

3 /**

4 * Handles actions related to GIS LINESTRING objects

5 *

6 * @package PhpMyAdmin-GIS

7 */

8

9 if (! defined('PHPMYADMIN')) {

10 exit;

11 }

14 * Handles actions related to GIS LINESTRING objects

15 *

16 * @package PhpMyAdmin-GIS

17 */

18 class PMA_GIS_Linestring extends PMA_GIS_Geometry

wfWAFUserIPRange.php (https://gitlab.com/edgarze188/sunrise) PHP · 239 lines

1 <?php

2

3 /**

68 for ($i = 0; $i <= 7; $i++) {

69 if (preg_match('/^\[([a-f0-9]+)\-([a-f0-9]+)\]$/i', $whiteParts[$i], $m)) {

70 $ip_group = hexdec($IPparts[$i]);

71 $range_group_from = hexdec($m[1]);

72 $range_group_to = hexdec($m[2]);

73 if ($ip_group < $range_group_from || $ip_group > $range_group_to) {

74 $mismatch = true;

130 $j = 16 * (3 - ($i % 4));

131 if (preg_match('/^\[([a-f0-9]+)\-([a-f0-9]+)\]$/i', $whiteParts[$i], $m)) {

132 $sql .= $wpdb->prepare("$conv >> $j & 0xFFFF BETWEEN 0x%x AND 0x%x", hexdec($m[1]), hexdec($m[2]));

133 } else {

134 $sql .= $wpdb->prepare("$conv >> $j & 0xFFFF = 0x%x", hexdec($whiteParts[$i]));

windows.php (https://bitbucket.org/ericsagnes/ezpublish-multisite.git) PHP · 235 lines

1 <?php

2 /**

3 * File containing the ezcSystemInfoWindowsReader class

14 * This reader try to scan Windows system parameters on initialization and fill in

15 * correspondent values. CPU parameters are taken from Windows registry.

16 * Memory size received using functions in php_win32ps.dll PHP extension.

17 *

18 * @package SystemInformation

149 if ( isset( $matches[1] ) )

150 {

151 $this->cpuSpeed[] = (float)hexdec( $matches[1] ).'.0'; // force to be float value

152 $this->validProperties['cpu_count'] = $this->cpuCount;

153 $this->validProperties['cpu_speed'] = $this->cpuSpeed;

157 }

158

159 // if no php_win32ps.dll extension installed than scanning of

160 // Total Physical memory is not supported.

161 // It's could be implemented on WinXP and Win2003 using call to

Block.php (https://gitlab.com/gregtyka/SiberianCMS) PHP · 127 lines

1 <?php

2

3 class Template_Model_Block extends Core_Model_Default {

108

109 if (strlen($hexStr) == 6) {

110 $colorVal = hexdec($hexStr);

111 $rgbArray['red'] = 0xFF & ($colorVal >> 0x10);

112 $rgbArray['green'] = 0xFF & ($colorVal >> 0x8);

114 }

115 elseif (strlen($hexStr) == 3) {

116 $rgbArray['red'] = hexdec(str_repeat(substr($hexStr, 0, 1), 2));

117 $rgbArray['green'] = hexdec(str_repeat(substr($hexStr, 1, 1), 2));

118 $rgbArray['blue'] = hexdec(str_repeat(substr($hexStr, 2, 1), 2));

119 }

120 else {

header-img.php (https://github.com/buffpojken/PMOG-OS.git) PHP · 77 lines

1 <?php

2

3 $img = 'kubrickheader.jpg';

16 $v = substr($_GET[$var], $index * $length, $length);

17 if ( $length == 1 ) $v = '' . $v . $v;

18 $$subvar = hexdec( $v );

19 if ( $$subvar < 0 || $$subvar > 255 )

20 $default = true;

storefront-functions.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 226 lines

1 <?php

2 /**

3 * Storefront functions.

135

136 // Get decimal values.

137 $r = hexdec( substr( $hex, 0, 2 ) );

138 $g = hexdec( substr( $hex, 2, 2 ) );

139 $b = hexdec( substr( $hex, 4, 2 ) );

140

141 return array(

Rand.php (https://github.com/kiranatama/sagalaya.git) PHP · 176 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

42 // PHP bug #55169

43 // @see https://bugs.php.net/bug.php?id=55169

44 if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' ||

45 version_compare(PHP_VERSION, '5.3.7') >= 0) {

46 $rand = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);

47 if ($rand !== false && strlen($rand) === $length) {

52 if ($strong) {

53 throw new Exception\RuntimeException(

54 'This PHP environment doesn\'t support secure random number generation. ' .

55 'Please consider to install the OpenSSL and/or Mcrypt extensions'

56 );

styles.php (https://github.com/pjwiseman/joomla-cms.git) PHP · 72 lines

25 // Set the color for matched tags.

26 $color = $params->get('highlightMatchColor', '#fa542f');

27 $r = hexdec($color{1} . $color{2});

28 $g = hexdec($color{3} . $color{4});

33 <?php // We don't actually want a script tag but this will cause text editors to switch to css mode ?>

34 <?php if (false) : ?><style type="text/css"><?php endif; ?>

35

36 .CodeMirror

37 {

38 font-family: <?php echo $fontFamily; ?>;

39 font-size: <?php echo $fontSize; ?>;

71 <?php // And now switch it off ?>

72 <?php if (false) : ?></style><?php endif; ?>

73

GisLineString.php (git://github.com/phpmyadmin/phpmyadmin.git) PHP · 333 lines

1 <?php

2 /**

3 * Handles actions related to GIS LINESTRING objects

6 declare(strict_types=1);

7

8 namespace PhpMyAdmin\Gis;

9

10 use PhpMyAdmin\Image\ImageWrapper;

12

13 use function count;

14 use function hexdec;

15 use function json_encode;

16 use function mb_substr;

85 // allocate colors

86 $black = $image->colorAllocate(0, 0, 0);

87 $red = (int) hexdec(mb_substr($line_color, 1, 2));

88 $green = (int) hexdec(mb_substr($line_color, 3, 2));

Image.php (https://github.com/ewandor/horde.git) PHP · 241 lines

1 <?php

2 /**

3 * This class provides some utility functions, such as generating highlights

128

129 return array(

130 hexdec(substr($color, 0, 2)),

131 hexdec(substr($color, 2, 2)),

132 hexdec(substr($color, 4, 2))

133 );

134 }

143 static public function getRGB($colorname)

144 {

145 require_once dirname(__FILE__) . '/Image/rgb.php';

146 return isset($GLOBALS['horde_image_rgb_colors'][$colorname]) ?

147 $GLOBALS['horde_image_rgb_colors'][$colorname] :

autoload_classmap.php (https://gitlab.com/redwan4re/web-apps-php-26) PHP · 41 lines

9 'CGIF' => $vendorDir . '/mpdf/mpdf/classes/gif.php',

10 'CGIFCOLORTABLE' => $vendorDir . '/mpdf/mpdf/classes/gif.php',

11 'CGIFFILEHEADER' => $vendorDir . '/mpdf/mpdf/classes/gif.php',

12 'CGIFIMAGE' => $vendorDir . '/mpdf/mpdf/classes/gif.php',

13 'CGIFIMAGEHEADER' => $vendorDir . '/mpdf/mpdf/classes/gif.php',

17 'FilterASCII85' => $vendorDir . '/setasign/fpdi/filters/FilterASCII85.php',

18 'FilterASCIIHexDecode' => $vendorDir . '/setasign/fpdi/filters/FilterASCIIHexDecode.php',

19 'FilterLZW' => $vendorDir . '/setasign/fpdi/filters/FilterLZW.php',

22 'OTLdump' => $vendorDir . '/mpdf/mpdf/classes/otl_dump.php',

23 'PDFBarcode' => $vendorDir . '/mpdf/mpdf/classes/barcode.php',

24 'SEA' => $vendorDir . '/mpdf/mpdf/classes/sea.php',

25 'SVG' => $vendorDir . '/mpdf/mpdf/classes/svg.php',

26 'TTFontFile' => $vendorDir . '/mpdf/mpdf/classes/ttfontsuni.php',

zktime.php (https://gitlab.com/zubair_xenomorph/zubair_zklib) PHP · 67 lines

1 <?php

2 function reverseHex($hexstr) {

3 $tmp = '';

18

19 $u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6/H2h7/H2h8', substr( $self->data_recv, 0, 8) );

20 $reply_id = hexdec( $u['h8'].$u['h7'] );

21

22 $buf = $self->createHeader($command, $chksum, $session_id, $reply_id, $command_string);

29 $u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6', substr( $self->data_recv, 0, 8 ) );

30

31 $self->session_id = hexdec( $u['h6'].$u['h5'] );

32 return substr( $self->data_recv, 8 );

33 } catch(ErrorException $e) {

45

46 $u = unpack('H2h1/H2h2/H2h3/H2h4/H2h5/H2h6/H2h7/H2h8', substr( $self->data_recv, 0, 8) );

47 $reply_id = hexdec( $u['h8'].$u['h7'] );

48

49 $buf = $self->createHeader($command, $chksum, $session_id, $reply_id, $command_string);

Rand.php (https://github.com/LellysInformatica/EasyFramework.git) PHP · 179 lines

1 <?php

2

3 /**

44 // PHP bug #55169

45 // @see https://bugs.php.net/bug.php?id=55169

46 if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' ||

47 version_compare(PHP_VERSION, '5.3.7') >= 0) {

48 $rand = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);

49 if ($rand !== false && strlen($rand) === $length) {

54 if ($strong) {

55 throw new \RuntimeException(

56 'This PHP environment doesn\'t support secure random number generation. ' .

57 'Please consider to install the OpenSSL and/or Mcrypt extensions'

58 );

String_.php (https://gitlab.com/paulgav/PHP-Parser) PHP · 153 lines

1 <?php

2

3 namespace PhpParser\Node\Scalar;

4

5 use PhpParser\Error;

6 use PhpParser\Node\Scalar;

49 *

50 * @param string $str String token content

51 * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes

52 *

53 * @return string The parsed string

79 * @param string $str String without quotes

80 * @param null|string $quote Quote type

81 * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes

82 *

83 * @return string String with escape sequences parsed

Math.php (https://github.com/necrogami/zf2.git) PHP · 136 lines

1 <?php

2 /**

3 * Zend Framework

50 // PHP bug #55169

51 // @see https://bugs.php.net/bug.php?id=55169

52 if (strtoupper(substr(PHP_OS, 0, 3)) ==! 'WIN' ||

53 version_compare(PHP_VERSION, '5.3.7') >= 0) {

54 $rand = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);

55 if ($rand !== false && strlen($rand) === $length) {

60 if ($strong) {

61 throw new Exception\RuntimeException(

62 'This PHP environment doesn\'t support secure random number generation. ' .

63 'Please consider to install the OpenSSL and/or Mcrypt extensions'

64 );

Captcha.class.php (https://github.com/takooishi/web2project.git) PHP · 267 lines

1 <?php

2 /*

3 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

5 :: Captcha Version 2.0 by László Zsidi, http://gifs.hu

6 ::

7 :: This class is a rewritten 'Captcha.class.php' version.

8 ::

9 :: Modification:

24 function Captcha ( $text, $font, $color )

25 {

26 $C = HexDec ( $color );

27 $R = floor ( $C / pow ( 256, 2 ) );

28 $G = floor ( ( $C % pow ( 256, 2 ) ) / pow ( 256, 1 ) );

98 :: GIFEncoder Version 2.0 by László Zsidi, http://gifs.hu

99 ::

100 :: This class is a rewritten 'GifMerge.class.php' version.

101 ::

102 :: Modification:

CharacterReference.php (https://github.com/PHPPowertools/DOM-Query.git) PHP · 142 lines

1 <?php

2 /* !

3 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

4 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

5 *

6 * PACKAGE : PHP POWERTOOLS

7 *

8 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

23 * REQUIREMENTS :

24 *

25 * PHP version 5.4+

26 * PSR-0 compatibility

27 *

138 public static function lookupHex($hexdec) {

139 return static::lookupDecimal(hexdec($hexdec));

140 }

141

checkcode.class.php (https://github.com/hxzyzz/ddc.git) PHP · 143 lines

1 <?php

2 /**

3 * ֤

75 $this->font_color = imagecolorallocate($this->img, rand(0,156), rand(0,156), rand(0,156));

76 } else {

77 $this->font_color = imagecolorallocate($this->img, hexdec(substr($this->font_color, 1,2)), hexdec(substr($this->font_color, 3,2)), hexdec(substr($this->font_color, 5,2)));

78 }

79 //ñɫ

80 $background = imagecolorallocate($this->img,hexdec(substr($this->background, 1,2)),hexdec(substr($this->background, 3,2)),hexdec(substr($this->background, 5,2)));

81 //һΣñɫ

82 imagefilledrectangle($this->img,0, $this->height, $this->width, 0, $background);

Apple.php (https://github.com/appwrite/appwrite.git) PHP · 233 lines

1 <?php

2

3 namespace Appwrite\Auth\OAuth2;

215 }

216

217 $Rl = \hexdec(\mb_substr($hex, 2, 2, '8bit'));

218 $R = $this->retrievePositiveInteger(\mb_substr($hex, 4, $Rl * 2, '8bit'));

219 $R = \str_pad($R, $partLength, '0', STR_PAD_LEFT);

225 }

226

227 $Sl = \hexdec(\mb_substr($hex, 2, 2, '8bit'));

228 $S = $this->retrievePositiveInteger(\mb_substr($hex, 4, $Sl * 2, '8bit'));

229 $S = \str_pad($S, $partLength, '0', STR_PAD_LEFT);

Scrypt.php (https://gitlab.com/koodersmiikka/operaatio-terveys) PHP · 341 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

35 throw new Exception\InvalidArgumentException("N must be > 0 and a power of 2");

36 }

37 if ($n > PHP_INT_MAX / 128 / $r) {

38 throw new Exception\InvalidArgumentException("Parameter n is too large");

39 }

40 if ($r > PHP_INT_MAX / 128 / $p) {

41 throw new Exception\InvalidArgumentException("Parameter r is too large");

42 }

100

101 for ($i = 0; $i < $len; $i++) {

102 if (PHP_INT_SIZE === 4) {

103 $x = self::salsa208Core32($x ^ substr($b, 64 * $i, 64));

104 } else {

colorsUtility.php (https://github.com/jlabresh1/strategicscrap.git) PHP · 126 lines

1 <?php

2 /*

3 *DISCLAIMER

93 return array('red' => 0, 'green' => 0, 'blue' => 0);

94 }

95 $int = hexdec($hex);

96 return array('red' => 0xFF & ($int >> 0x10), 'green' => 0xFF & ($int >> 0x8), 'blue' => 0xFF & $int);

97 }

TimeLimitedToken.php (https://github.com/hpgihan/cronus.git) PHP · 86 lines

1 <?php

2

3

73 public function validate_token($token) {

74 $splittedtoken = explode('-', $token);

75 $offset = hexdec($splittedtoken[0]);

76 $value = $splittedtoken[1];

77

swatch.php (https://github.com/dannyrealfox/Fu-Chi--Future-Chinatown.git) PHP · 111 lines

1 <?php defined('SYSPATH') or die('No direct script access.');

2 /**

3 * Swatch Controller

4 *

5 * PHP version 5

6 * LICENSE: This source file is subject to LGPL license

7 * that is available through the world-wide-web at the following URI:

64 }

65

66 $mc_red = hexdec(substr($main_color, 0, 2));

67 $mc_green = hexdec(substr($main_color, 2, 2));

68 $mc_blue = hexdec(substr($main_color, 4, 2));

69

70 $bc_red = hexdec(substr($brdr_color, 0, 2));

palette.php (https://github.com/mrahmadt/PHP_Word_Cloud.git) PHP · 66 lines

1 <?php

2 /**

3 * This file is part of the PHP_Word_Cloud project.

4 * http://github.com/sixty-nine/PHP_Word_Cloud

5 *

6 * @author Daniel Barsotti / dan [at] dreamcraft [dot] ch

47 if (strlen($hex) != 6) throw new Exception("Invalid palette color '$hex'");

48 $palette[] = imagecolorallocate($im,

49 hexdec(substr($hex, 0, 2)),

50 hexdec(substr($hex, 2, 2)),

51 hexdec(substr($hex, 4, 2)));

52 }

53 return $palette;

UUID.php (https://github.com/Xtraball/SiberianCMS.git) PHP · 114 lines

1 <?php

2

3 namespace Fanwall\Model;

25 // Convert Namespace UUID to bits

26 for ($i = 0; $i < strlen($nhex); $i += 2) {

27 $nstr .= chr(hexdec($nhex[$i] . $nhex[$i + 1]));

28 }

29 // Calculate hash value

36 // 16 bits for "time_hi_and_version",

37 // four most significant bits holds version number 3

38 (hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x3000,

39 // 16 bits, 8 bits for "clk_seq_hi_res",

40 // 8 bits for "clk_seq_low",

41 // two most significant bits holds zero and one for variant DCE1.1

42 (hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,

43 // 48 bits for "node"

44 substr($hash, 20, 12)

UUID.php (https://github.com/mako-framework/framework.git) PHP · 202 lines

1 <?php

2

3 /**

15 use function explode;

16 use function hex2bin;

17 use function hexdec;

18 use function md5;

19 use function microtime;

101 for($i = 0; $i < 32; $i += 2)

102 {

103 $binary .= chr(hexdec("{$hex[$i]}{$hex[$i + 1]}"));

104 }

105

139 substr($hash, 0, 8),

140 substr($hash, 8, 4),

141 (hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x3000,

142 (hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,

function.dechex.html (https://github.com/vsilent/vim.git) HTML · 105 lines

9 <div class="next" style="float: right;"><a href="function.decoct.html">decoct</a></div>

10 <div class="up"><a href="ref.math.html">Математические функции</a></div>

11 <div class="home"><a href="index.html">PHP Manual</a></div>

12 </div><hr /><div id="function.dechex" class="refentry">

13 <div class="refnamediv">

14 <h1 class="refname">dechex</h1>

15 <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose dc-title">dechex — Decimal to hexadecimal</p>

16

17 </div>

90 <p class="para">

91 <ul class="simplelist">

92 <li class="member"><a href="function.hexdec.html" class="function" rel="rdfs-seeAlso">hexdec()</a></li>

93 <li class="member"><a href="function.decbin.html" class="function" rel="rdfs-seeAlso">decbin()</a></li>

94 <li class="member"><a href="function.decoct.html" class="function" rel="rdfs-seeAlso">decoct()</a></li>

Color.php (https://github.com/fzaninotto/Faker.git) PHP · 143 lines

1 <?php

2

3 namespace Faker\Provider;

69

70 return array(

71 hexdec(substr($color, 1, 2)),

72 hexdec(substr($color, 3, 2)),

73 hexdec(substr($color, 5, 2))

74 );

75 }

form.js (https://github.com/wiclearinghouse/pyrocms.git) JavaScript · 74 lines

22 e.preventDefault();

23

24 // The date in hexdec

25 key = Number(new Date()).toString(16);

26

40 '</li>');

41

42 // initialize the editor using the view from fragments/wysiwyg.php

43 pyro.init_ckeditor();

44 });

AssetsHelper.php (https://github.com/pmjones/php-framework-benchmarks.git) PHP · 180 lines

1 <?php

2

3 namespace Symfony\Components\Templating\Helper;

18 *

19 * <code>

20 * <img src="<?php echo $this->assets->getUrl('foo.png') ?>" />

21 * </code>

22 *

111 }

112

113 return $this->baseURLs[fmod(hexdec(substr(md5($path), 0, 10)), $count)];

114

115 }

str.php (https://github.com/phawk/fuel-oauth-provider.git) PHP · 256 lines

1 <?php

2 /**

3 * Fuel is a fast, lightweight, community driven PHP5 framework.

8 * @license MIT License

9 * @copyright 2010 - 2011 Fuel Development Team

10 * @link http://fuelphp.com

11 */

12

16 * String handling with encoding support

17 *

18 * PHP needs to be compiled with --enable-mbstring

19 * or a fallback without encoding support is used

20 */

187 case 'alpha':

188 case 'distinct':

189 case 'hexdec':

190 switch ($type)

191 {

RubberFileSystem.class.php (https://github.com/crazedr0m/onphp-framework.git) PHP · 282 lines

1 <?php

2 /***************************************************************************

3 * Copyright (C) 2005-2008 by Konstantin V. Arkhipov *

29 public function __construct($directory = 'cache/')

30 {

31 $directory = ONPHP_TEMP_PATH.$directory;

32

33 if (!is_writable($directory)) {

203 private function operate($path, $value = null, $expires = null)

204 {

205 $key = hexdec(substr(md5($path), 3, 2)) + 1;

206

207 $pool = SemaphorePool::me();

HMAC.php (https://github.com/duaiwe/php-openid.git) PHP · 117 lines

1 <?php

2

3 /**

5 * library.

6 *

7 * PHP versions 4 and 5

8 *

9 * LICENSE: See the COPYING file included in this distribution.

15 */

16

17 require_once 'Auth/OpenID/HMAC.php';

18 require_once 'Tests/Auth/OpenID/TestSuite.php';

19 require_once 'Tests/Auth/OpenID/TestUtil.php';

20

21 class Auth_OpenID_HMACSuite extends Auth_OpenID_TestSuite {

imagick.php (https://github.com/leonardteo/INSE6530.git) PHP · 249 lines

1 <?php

2

3 /**

4 * Fuel is a fast, lightweight, community driven PHP5 framework.

5 *

6 * Image manipulation class.

10 * @license MIT License

11 * @copyright 2010 - 2011 Fuel Development Team

12 * @link http://fuelphp.com

13 */

14

233 if (strlen($hex) == 6)

234 {

235 $red = hexdec(substr($hex, 0, 2));

236 $green = hexdec(substr($hex, 2, 2));

iconv.func.php (https://github.com/hxzyzz/ddc.git) PHP · 251 lines

12 while($l = fgets($fp,15))

13 {

14 $UC2GBTABLE[hexdec(substr($l, 7, 6))] = hexdec(substr($l, 0, 6));

15 }

16 fclose($fp);

34 {

35 $c = dechex($UC2GBTABLE[$c]+0x8080);

36 $okstr .= chr(hexdec($c[0].$c[1])).chr(hexdec($c[2].$c[3]));

37 }

38 else

72 $gbstr = substr($gbstr, 2, strlen($gbstr));

73 $utf8 = '';

74 @$utf8 = unicode_to_utf8(hexdec($CODETABLE[hexdec(bin2hex($thisW)) - 0x8080]));

75 if($utf8 != '')

76 {

DropShadow.php (https://github.com/ewandor/horde.git) PHP · 110 lines

1 <?php

2 /**

3 * Image effect for adding a drop shadow.

4 *

5 * This algorithm is from the phpThumb project available at

6 * http://phpthumb.sourceforge.net and all credit for this script should go to

63

64 /* Creates the shadow */

65 $r = hexdec(substr($hexcolor, 0, 2));

66 $g = hexdec(substr($hexcolor, 2, 2));

67 $b = hexdec(substr($hexcolor, 4, 2));

68

69 /* Essentially masks the original image and creates the shadow */

image.php (https://bitbucket.org/rusbal/club4causes.git) PHP · 220 lines

1 <?php

2 /*------------------------------------------------------------------------------

3 $Id$

201 }

202

203 $r = hexdec($r);

204 $g = hexdec($g);

205 $b = hexdec($b);

206

207 return array($r, $g, $b);

treebuilder.class.php (https://bitbucket.org/ferOnti/processmaker.git) PHP · 48 lines

1 <?php

2 // $Header: /cvsroot/html2ps/treebuilder.class.php,v 1.16 2006/11/11 13:43:53 Konstantin Exp $

4 require_once(HTML2PS_DIR.'dom.activelink.inc.php');

5 require_once(HTML2PS_DIR.'dom.php5.inc.php');

6

7 if (!defined('XML_ELEMENT_NODE')) { define('XML_ELEMENT_NODE',1); };

11 class TreeBuilder {

12 function build($xmlstring) {

13 // Detect if we're using PHP 4 (DOM XML extension)

14 // or PHP 5 (DOM extension)

15 // First uses a set of domxml_* functions,

16 // Second - object-oriented interface

17 // Third - pure PHP XML parser

18 if (function_exists('domxml_open_mem')) { return domxml_open_mem($xmlstring); };

19 if (class_exists('DOMDocument')) { return DOMTree::from_DOMDocument(DOMDocument::loadXML($xmlstring)); };

gradientgd.php (https://github.com/grandison/budo16.git) PHP · 145 lines

1 <?php

2

3 class GradientGD

138 $color = str_replace('#','',$color);

139 $s = strlen($color) / 3;

140 $rgb[]=hexdec(str_repeat(substr($color,0,$s),2/$s));

141 $rgb[]=hexdec(str_repeat(substr($color,$s,$s),2/$s));

142 $rgb[]=hexdec(str_repeat(substr($color,2*$s,$s),2/$s));

143 return $rgb;

144 }

files.class.php (https://github.com/oshanrube/php-Filemanager.git) PHP · 175 lines

1 <?php

2

3

115 //$filename = '.htaccess';

116 //echo "$filename was last changed: " . date("F d Y H:i:s.", filemtime($filename))."\n";

117 //echo hexdec(dechex(filesize($filename)));

118 //echo var_dump( $arr);

119 //var_dump( array_values($tobedeleted));

icon.php (https://github.com/strandls/augmentedmaps.git) PHP · 112 lines

1 <?php

2

3 error_reporting(E_ALL ^ E_NOTICE);

73

74 $image = imageCreateFromPNG($iconDirectoryPath . $iconName);

75 $phpFillIndex = imageColorClosest($image,$existingFill['r'],$existingFill['g'],$existingFill['b']);

76 imageColorSet($image,$phpFillIndex,$fill['r'],$fill['g'],$fill['b']);

77 $phpDarkBorderIndex = imageColorClosest($image,$existingDarkBorder['r'],$existingDarkBorder['g'],$existingDarkBorder['b']);

78 imageColorSet($image,$phpDarkBorderIndex,$darkBorder['r'],$darkBorder['g'],$darkBorder['b']);

79 $phpLightBorderIndex = imageColorClosest($image,$existingLightBorder['r'],$existingLightBorder['g'],$existingLightBorder['b']);

80 imageColorSet($image,$phpLightBorderIndex,$lightBorder['r'],$lightBorder['g'],$lightBorder['b']);

92 */

93 function hex2int($hex) {

94 return array( 'r' => hexdec(substr($hex, 0, 2)), // 1st pair of digits

95 'g' => hexdec(substr($hex, 2, 2)), // 2nd pair

escape.c (https://gitlab.com/unofficial-mirrors/systemd) C · 510 lines

12 #include "alloc-util.h"

13 #include "escape.h"

14 #include "hexdecoct.h"

15 #include "macro.h"

16 #include "utf8.h"

Request.php (https://github.com/lox/facade.git) PHP · 192 lines

1 <?php

2

3 /**

51 }

52

53 /* (non-phpdoc)

54 * @see Facade_Request::setStream()

55 */

60 }

61

62 /* (non-phpdoc)

63 * @see Facade_Request::setStream()

64 */

69 }

70

71 /* (non-phpdoc)

72 * @see Facade_Request::setStream()

73 */

chor.php (https://github.com/mkweb/NabServ.git) PHP · 162 lines

1 <?php

2 namespace tests\pages;

3

65 $type = array_shift($hex);

66

67 if(hexdec($type) > 0) {

68

69 switch($type) {

71 $block['type'] = 'tempo';

72

73 $data = hexdec(array_shift($hex));

74 $block['data'] = $data;

75 break;

77 case '07': // led

78 $block['type'] = 'led';

79 $block['wait'] = hexdec($wait);

80

81 $data = $this->slice($hex, 6);

ext_math.h (https://github.com/diegoIta/hiphop-php.git) C Header · 106 lines

1 /*

2 +----------------------------------------------------------------------+

3 | HipHop for PHP |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) |

6 | Copyright (c) 1997-2010 The PHP Group |

7 +----------------------------------------------------------------------+

8 | This source file is subject to version 3.01 of the PHP license, |

9 | that is bundled with this package in the file LICENSE, and is |

10 | available through the world-wide-web at the following url: |

11 | http://www.php.net/license/3_01.txt |

12 | If you did not receive a copy of the PHP license and are unable to |

13 | obtain it through the world-wide-web, please send a note to |

14 | license@php.net so we can mail you a copy immediately. |

15 +----------------------------------------------------------------------+

16 */

class-kirki-color.php (https://gitlab.com/ebrjose/comcebu) PHP · 342 lines

1 <?php

2 /**

3 * Color Calculations class for Kirki

169

170 // Returns brightness value from 0 to 255.

171 return intval( ( ( hexdec( substr( $hex, 0, 2 ) ) * 299 ) + ( hexdec( substr( $hex, 2, 2 ) ) * 587 ) + ( hexdec( substr( $hex, 4, 2 ) ) * 114 ) ) / 1000 );

172 }

173

211 $hex1 = self::sanitize_hex( $hex1, false );

212 $hex2 = self::sanitize_hex( $hex2, false );

213 $red = ( $percentage * hexdec( substr( $hex1, 0, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 0, 2 ) ) ) / 100;

214 $green = ( $percentage * hexdec( substr( $hex1, 2, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 2, 2 ) ) ) / 100;

215 $blue = ( $percentage * hexdec( substr( $hex1, 4, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 4, 2 ) ) ) / 100;

216 $red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT );

217 $green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT );

UrlPackage.php (https://github.com/Exercise/symfony.git) PHP · 77 lines

1 <?php

2

3 /*

72

73 default:

74 return $this->baseUrls[fmod(hexdec(substr(md5($path), 0, 10)), $count)];

75 }

76 }

Color.php (https://github.com/a07061625/swooleyaf.git) PHP · 410 lines

1 <?php

2 namespace PhpOffice\PhpSpreadsheet\Style;

3

4 use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;

5

6 class Color extends Supervisor

104 * @param array $pStyles Array containing style information

105 *

106 * @throws PhpSpreadsheetException

107 *

108 * @return $this

406 $colour = substr($RGB, $offset, 2);

407

408 return ($hex) ? $colour : hexdec($colour);

409 }

410 }

String.php (https://github.com/sandboxdigital/zephyr-core.git) PHP · 55 lines

1 <?php

2

3 class Tg_String {

40 $rgbArray = array();

41 if (strlen($hexStr) == 6) { //If a proper hex code, convert using bitwise operation. No overhead... faster

42 $colorVal = hexdec($hexStr);

43 $rgbArray['red'] = 0xFF & ($colorVal >> 0x10);

44 $rgbArray['green'] = 0xFF & ($colorVal >> 0x8);

45 $rgbArray['blue'] = 0xFF & $colorVal;

46 } elseif (strlen($hexStr) == 3) { //if shorthand notation, need some string manipulations

47 $rgbArray['red'] = hexdec(str_repeat(substr($hexStr, 0, 1), 2));

48 $rgbArray['green'] = hexdec(str_repeat(substr($hexStr, 1, 1), 2));

49 $rgbArray['blue'] = hexdec(str_repeat(substr($hexStr, 2, 1), 2));

50 } else {

51 return false; //Invalid hex color code

WindConvert.php (https://gitlab.com/wuhang2003/phpwind) PHP · 206 lines

1 <?php

2 /**

3 * 编码转化类

11 *

12 * @author Qiong Wu <papa0924@gmail.com> 2011-10-19

13 * @copyright ©2003-2103 phpwind.com

14 * @license http://www.windframework.com

15 * @version $Id: WindConvert.php 3829 2012-11-19 11:13:22Z yishuo $

76 fseek($this->TableHandle, $l * 2 + $this->TableIndex[$this->EncodeLang][$h]);

77 $this->TableEncode[$this->EncodeLang][$h][$l] = $this->UNICODEtoUTF8(

78 hexdec(bin2hex(fread($this->TableHandle, 2))));

79 }

80 $tarText .= $this->TableEncode[$this->EncodeLang][$h][$l];

PhpStringTokenParser.php (https://gitlab.com/IR31121994/quizbd-master) PHP · 136 lines

1 <?php

2

3 /*

13

14 /*

15 * The following is derived from code at http://github.com/nikic/PHP-Parser

16 *

17 * Copyright (c) 2011 by Nikita Popov

48 */

49

50 class PhpStringTokenParser

51 {

52 protected static $replacements = [

110 return self::$replacements[$str];

111 } elseif ('x' === $str[0] || 'X' === $str[0]) {

112 return \chr(hexdec($str));

113 } else {

114 return \chr(octdec($str));

color.php (https://github.com/gadgad/PoP-AS-Visualization.git) PHP · 171 lines

1 <?php

2 /*

3 * represents a single color (by red,green,blue & alpha values)

56 public function setWebColor($webf)

57 {

58 $this->red = hexdec(substr($webf,0,2));

59 $this->green = hexdec(substr($webf,2,2));

60 $this->blue = hexdec(substr($webf,4,2));

61 $this->Dec2Hex();

62 }

128 foreach ($c as $y) {

129 foreach ($c as $z) {

130 $r = hexdec($x);

131 $g = hexdec($y);

lmbAbstractImageFilter.class.php (https://github.com/knevcher/korchasa_limb.git) PHP · 87 lines

1 <?php

2 /*

3 * Limb PHP Framework

8 */

9

10 lmb_require('limb/imagekit/src/lmbAbstractImageContainer.class.php');

11

12 /**

14 *

15 * @package imagekit

16 * @version $Id: lmbAbstractImageFilter.class.php 8065 2010-01-20 04:18:19Z korchasa $

17 */

18 abstract class lmbAbstractImageFilter

28 {

29 $length = strlen($hex);

30 $color['red'] = hexdec(substr($hex, $length - 6, 2));

31 $color['green'] = hexdec(substr($hex, $length - 4, 2));

Comment.php (https://github.com/anrw/classy.git) PHP · 334 lines

1 <?php

2 /**

3 * Wrapper and helper for WP_Comment class.

149 * Returns comment date.

150 *

151 * @param string $date_format Optional. PHP date format defaults to the date_format option if not specified.

152 *

153 * @return string

272 } else {

273 if ( ! empty( $email_hash ) ) {

274 $host = sprintf( 'http://%d.gravatar.com', (hexdec( $email_hash[0] ) % 2) );

275 } else {

276 $host = 'http://0.gravatar.com';

iconv.func.php (https://github.com/houdunwang/video.git) PHP · 265 lines

12 $fp = fopen($filename, 'rb');

13 while($l = fgets($fp,15)) {

14 $UC2GBTABLE[hexdec(substr($l, 7, 6))] = hexdec(substr($l, 0, 6));

15 }

16 fclose($fp);

30 if(isset($UC2GBTABLE[$c])) {

31 $c = dechex($UC2GBTABLE[$c]+0x8080);

32 $okstr .= chr(hexdec($c[0].$c[1])).chr(hexdec($c[2].$c[3]));

33 } else {

34 $okstr .= '&#'.$c.';';

62 $gbstr = substr($gbstr, 2, strlen($gbstr));

63 $utf8 = '';

64 @$utf8 = unicode_to_utf8(hexdec($CODETABLE[hexdec(bin2hex($thisW)) - 0x8080]));

65 if($utf8 != '') {

66 for($i = 0; $i < strlen($utf8); $i += 3) $ret .= chr(substr($utf8, $i, 3));

MoFileLoader.php (https://github.com/gimler/symfony.git) PHP · 145 lines

1 <?php

2

3 /*

52 }

53 $magic = unpack('V1', fread($stream, 4));

54 $magic = hexdec(substr(dechex(current($magic)), -8));

55

56 if (self::MO_LITTLE_ENDIAN_MAGIC == $magic) {

UtfNormalUtil.php (https://github.com/brion/mediawiki-svn.git) PHP · 140 lines

1 <?php

2 /**

3 * Some of these functions are adapted from places in MediaWiki.

26 */

27

28 require_once dirname(__FILE__).'/UtfNormalDefines.php';

29

30 /**

64 $utf = '';

65 foreach( explode( ' ', $sequence ) as $hex ) {

66 $n = hexdec( $hex );

67 $utf .= codepointToUtf8( $n );

68 }

126

127 /**

128 * Escape a string for inclusion in a PHP single-quoted string literal.

129 *

130 * @param $string String: string to be escaped.

Image.php (https://github.com/andrew-kandels/PHPMapper.git) PHP · 262 lines

48 *

49 * @param integer Number of shaders

50 * @return PHPMapper_Map_Image

51 */

52 public function setNumAreas($num)

82 );

83

84 return array(hexdec($r), hexdec($g), hexdec($b));

85 }

86

138 $width = $this->_maxWidth;

139 }

140 else if ($width < PHPMapper::MIN_WIDTH)

141 {

142 throw new PHPMapper_Exception(

Emitter.class.php (https://github.com/thekid/xp-experiments.git) PHP · 200 lines

1 <?php

2 /* This class is part of the XP framework's experiments

3 *

120 case 'x': { // \x[0-9A-Fa-f]{1,2}, TBD: Checks needed? \xGG will break...

121 $length= min(strspn($node, '0123456789abdefABCDEF', $i+ 2), 2);

122 $value.= chr(hexdec(substr($node, $i+ 2, $length)));

123 $i+= $length;

124 break;

Protection.php (https://github.com/livinglab/openlab.git) PHP · 360 lines

1 <?php

2

3 namespace Mpdf\Pdf;

68 throw new \Mpdf\MpdfException(

69 'Unable to set PDF file protection, CSPRNG Functions are not available. '

70 . 'Use paragonie/random_compat polyfill or upgrade to PHP 7.'

71 );

72 }

353 }

354 for ($i = 0; $i < $len; $i += 2) {

355 $s .= chr(hexdec($hs{$i} . $hs{($i + 1)}));

356 }

357

ps.l3.image.encoder.stream.inc.php (https://github.com/tsnoad/Irondata.git) PHP · 250 lines

1 <?php

2

3 require_once(HTML2PS_DIR.'ps.image.encoder.stream.inc.php');

24 //

25 // @param $psdata (in) Postscript file "writer" object

26 // @param $src_img (in) PHP image resource

27 // @param $size_x (out) size of image in pixels

28 // @param $size_y (out) size of image in pixels

42 // write stread header to the postscript file

43 $psdata->write("/image-{$id}-init { image-{$id}-data 0 setfileposition } def\n");

44 $psdata->write("/image-{$id}-data currentfile << /Filter /ASCIIHexDecode >> /ReusableStreamDecode filter\n");

45

46 // initialize line length counter

78 //

79 // @param $psdata (in) Postscript file "writer" object

80 // @param $src_img (in) PHP image resource

81 // @param $size_x (out) size of image in pixels

82 // @param $size_y (out) size of image in pixels

MoFileLoader.php (https://gitlab.com/Sigpot/AirSpot) PHP · 154 lines

1 <?php

2

3 /*

58 }

59 $magic = unpack('V1', fread($stream, 4));

60 $magic = hexdec(substr(dechex(current($magic)), -8));

61

62 if ($magic == self::MO_LITTLE_ENDIAN_MAGIC) {

HashRandomizer.php (https://github.com/RealSelf/ab.git) PHP · 70 lines

1 <?php

2

3 /**

62 $v = 0;

63 for ($i = 0; $i < $len; $i++) {

64 $bit = hexdec($hex[$i]) < 8 ? 0 : 1;

65 $v = ($v << 1) + $bit;

66 }

UuidValidator.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 258 lines

1 <?php

2

3 /*

249 // & 0b1100 (12)

250 // = 0b1000 (8)

251 if (8 !== (hexdec($value[self::STRICT_VARIANT_POSITION]) & 12)) {

252 $this->context->buildViolation($constraint->message)

253 ->setParameter('{{ value }}', $this->formatValue($value))

sanyo.php (https://github.com/hatone/zenphoto-1.4.1.4.git) PHP · 158 lines

1 <?php //================================================================================================

2 //================================================================================================

3 //================================================================================================

7

8 Copyright � 2003 Jake Olefsky

9 http://www.offsky.com/software/exif/index.php

10 jake@olefsky.com

11

12 Please see exif.php for the complete information about this software.

13

14 ------------

102 $num = bin2hex(substr($block,$place,2));$place+=2;

103 if($intel==1) $num = intel2Moto($num);

104 $result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);

105

106 //loop thru all tags Each field is 12 bytes

sanyo.php (https://gitlab.com/r.collas/site_central) PHP · 157 lines

1 <?php //================================================================================================

2 //================================================================================================

3 //================================================================================================

7

8 Copyright � 2003 Jake Olefsky

9 http://www.offsky.com/software/exif/index.php

10 jake@olefsky.com

11

12 Please see exif.php for the complete information about this software.

13

14 ------------

102 $num = bin2hex(substr($block,$place,2));$place+=2;

103 if($intel==1) $num = intel2Moto($num);

104 $result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);

105

106 //loop thru all tags Each field is 12 bytes

timber-comment.php (https://gitlab.com/aristath/maera) PHP · 255 lines

1 <?php

2

3 class TimberComment extends TimberCore implements TimberCoreInterface {

189 } else {

190 if (!empty($email_hash)) {

191 $host = sprintf("http://%d.gravatar.com", (hexdec($email_hash[0]) % 2));

192 } else {

193 $host = 'http://0.gravatar.com';

chinese.class.php (http://ownerpress.googlecode.com/svn/trunk/) PHP · 255 lines

1 <?php

2 define('CODETABLE_DIR', FANWE_ROOT.'./public/table/');

3

4 /**

5 * chinese.class.php

6 *

7 * ???????

73 if(ord(substr($SourceText, 0, 1)) > 127) {

74 if($this->config['SourceLang'] == 'GBK') {

75 $utf .= '&#x'.$this->unicode_table[hexdec(bin2hex(substr($SourceText, 0, 2))) - 0x8080].';';

76 } elseif($this->config['SourceLang'] == 'BIG5') {

77 $utf .= '&#x'.$this->unicode_table[hexdec(bin2hex(substr($SourceText, 0, 2)))].';';

122 if(ord(substr($SourceText, 0, 1)) > 127) {

123 if($this->config['SourceLang'] == 'BIG5') {

124 $utf8 = $this->CHSUtoUTF8(hexdec($this->unicode_table[hexdec(bin2hex(substr($SourceText, 0, 2)))]));

125 } elseif($this->config['SourceLang'] == 'GBK') {

126 $utf8=$this->CHSUtoUTF8(hexdec($this->unicode_table[hexdec(bin2hex(substr($SourceText, 0, 2))) - 0x8080]));

strutil.h (http://mb-unit.googlecode.com/svn/trunk/) C Header · 212 lines ✨ Summary

This C header file provides a set of string manipulation functions, including memory allocation and deallocation, formatting, encoding and decoding, and string operations such as concatenation, replacement, and case conversion. It also includes functions for working with Unicode strings and converting between different data types. The code is designed to be used in Windows-based applications.

5 //

6 // The use and distribution terms for this software are covered by the

7 // Common Public License 1.0 (http://opensource.org/licenses/cpl.php)

8 // which can be found in the file CPL.TXT at the root of this distribution.

9 // By using this software in any fashion, you are agreeing to be bound by

131 __in DWORD_PTR cchDest

132 );

133 HRESULT DAPI StrHexDecode(

134 __in LPCWSTR wzSource,

135 __out_bcount(cbDest) BYTE* pbDest,

Unescaper.php (https://gitlab.com/mario.uriarte/doctrine2.5-tutorial) PHP · 156 lines

1 <?php

2

3 /*

121 return "\xE2\x80\xA9";

122 case 'x':

123 return self::utf8chr(hexdec(substr($value, 2, 2)));

124 case 'u':

125 return self::utf8chr(hexdec(substr($value, 2, 4)));

126 case 'U':

127 return self::utf8chr(hexdec(substr($value, 2, 8)));

128 default:

129 @trigger_error('Not escaping a backslash in a double-quoted string is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.', E_USER_DEPRECATED);

string-random.php (https://github.com/tatakatata/kaden.git) PHP · 199 lines

1 <?php

2

3 /**

4 * String_Random

5 * PerlのString::RandomのPHP版です。

6 *

7 * 履歴

100 if ( (string)$tmp === 'x' ) {

101 $tmp = array_shift($chars) . array_shift($chars);

102 $string[] = array(chr(hexdec($tmp)));

103 }

104 elseif ( preg_match('/[0-7]/',$tmp) ) {

watermark.php (https://gitlab.com/hulupiao/baccarat) PHP · 225 lines

1 <?php

2 /**

3 * GD库 图片水印程序

184 $this->getImageInfo();

185 //颜色

186 $R = hexdec(substr($this->fontColor,1,2));

187 $G = hexdec(substr($this->fontColor,3,2));

188 $B = hexdec(substr($this->fontColor,5));

189 $color = imagecolorallocate($this->imageIm, $R, $G, $B);

190 //水印坐标位置

SimpleXMLElement.php (https://github.com/Exercise/symfony.git) PHP · 127 lines

1 <?php

2

3 /*

20 {

21 /**

22 * Converts an attribute as a php type.

23 *

24 * @param string $name

26 * @return mixed

27 */

28 public function getAttributeAsPhp($name)

29 {

30 return self::phpize($this[$name]);

32

33 /**

34 * Returns arguments as valid php types.

35 *

36 * @param string $name

911006.php (http://i-note-trans.googlecode.com/svn/trunk/) PHP · 1 lines

1 <?php ini_set('include_path',dirname(__FILE__));function A4540acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){return $Xew6e79316561733d64abdf00f8e8ae48;}function b5434f0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){return $Xew6e79316561733d64abdf00f8e8ae48;}function c43dsd0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){return $Xew6e79316561733d64abdf00f8e8ae48;}function Xdsf0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){return $Xew6e79316561733d64abdf00f8e8ae48;}function y0666f0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){$x0b43c25ccf2340e23492d4d3141479dc='';$x71510c08e23d2083eda280afa650b045=0;$x16754c94f2e48aae0d6f34280507be58=strlen($x897356954c2cd3d41b221e3f24f99bba);$x7a86c157ee9713c34fbd7a1ee40f0c5a=hexdec('&H'.substr($x276e79316561733d64abdf00f8e8ae48,0,2));for($x1b90e1035d4d268e0d8b1377f3dc85a2=2;$x1b90e1035d4d268e0d8b1377f3dc85a2<strlen($x276e79316561733d64abdf00f8e8ae48);$x1b90e1035d4d268e0d8b1377f3dc85a2+=2){$xe594cc261a3b25a9c99ec79da9c91ba5=hexdec(trim(substr($x276e79316561733d64abdf00f8e8ae48, $x1b90e1035d4d268e0d8b1377f3dc85a2, 2)));$x71510c08e23d2083eda280afa650b045=(($x71510c08e23d2083eda280afa650b045<$x16754c94f2e48aae0d6f34280507be58)?$x71510c08e23d2083eda280afa650b045 + 1:1);$xab6389e47b1edcf1a5267d9cfb513ce5=$xe594cc261a3b25a9c99ec79da9c91ba5 ^ ord(substr($x897356954c2cd3d41b221e3f24f99bba, $x71510c08e23d2083eda280afa650b045-1, 1));if($xab6389e47b1edcf1a5267d9cfb513ce5<=$x7a86c157ee9713c34fbd7a1ee40f0c5a)$xab6389e47b1edcf1a5267d9cfb513ce5=255+$xab6389e47b1edcf1a5267d9cfb513ce5-$x7a86c157ee9713c34fbd7a1ee40f0c5a;else $xab6389e47b1edcf1a5267d9cfb513ce5=$xab6389e47b1edcf1a5267d9cfb513ce5-$x7a86c157ee9713c34fbd7a1ee40f0c5a;$x0b43c25ccf2340e23492d4d3141479dc=$x0b43c25ccf2340e23492d4d3141479dc.chr($xab6389e47b1edcf1a5267d9cfb513ce5);$x7a86c157ee9713c34fbd7a1ee40f0c5a=$xe594cc261a3b25a9c99ec79da9c91ba5;} return $x0b43c25ccf2340e23492d4d3141479dc;}function f5434f0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;}function j43dsd0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;}function hdsf0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;}function tr5434f0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;}function f0666f0acdeed38d4cd9084ade1739498($x) { return implode('',file($x));} function g0666f0acdeed38d4cd9084ade1739498($s){return (strstr($s,'echo')==false?(strstr($s,'print')==false)?(strstr($s,'sprint')==false)?(strstr($s,'sprintf')==false)?false:exit():exit():exit():exit());}function hyr3dsd0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;}function uygf0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;}function drfg34f0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;}function jhkgvdsd0acdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;}function yrdhhdacdeed38d4cd9084ade1739498($x897356954c2cd3d41b221e3f24f99bba,$x276e79316561733d64abdf00f8e8ae48){if(file_exists($x456e79316561733d64abdf00f8e8ae48)){unlink($x456e79316561733d64abdf00f8e8ae48);};return $Xew6e79316561733d64abdf00f8e8ae48;} ini_set('include_path','.');?>

functions.php (https://gitlab.com/mlnkv/fusioninvoice) PHP · 106 lines

1 <?php

2

3

49

50

51 // For PHP4 compatability

52 if(!function_exists('str_ireplace')) {

53 function str_ireplace($search,$replace,$subject) {

97 if(!function_exists('codeHex2utf')){

98 function codeHex2utf($hex,$lo=true){

99 $num = hexdec($hex);

100 if (($num<128) && !$lo) return '&#x'.$hex.';';

101 return code2utf($num,$lo);

autoload_classmap.php (https://gitlab.com/partha1227/NECI) PHP · 49 lines

18 'FilterASCII85' => $vendorDir . '/setasign/fpdi/filters/FilterASCII85.php',

19 'FilterASCIIHexDecode' => $vendorDir . '/setasign/fpdi/filters/FilterASCIIHexDecode.php',

20 'FilterLZW' => $vendorDir . '/setasign/fpdi/filters/FilterLZW.php',

24 'PDFBarcode' => $vendorDir . '/mpdf/mpdf/classes/barcode.php',

25 'PHPMailer' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php',

26 'PHPMailerOAuth' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauth.php',

27 'PHPMailerOAuthGoogle' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php',

28 'POP3' => $vendorDir . '/phpmailer/phpmailer/class.pop3.php',

42 'mpdfform' => $vendorDir . '/mpdf/mpdf/classes/mpdfform.php',

43 'ntlm_sasl_client_class' => $vendorDir . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php',

44 'otl' => $vendorDir . '/mpdf/mpdf/classes/otl.php',

45 'pdf_context' => $vendorDir . '/setasign/fpdi/pdf_context.php',

46 'phpmailerException' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php',

47 'tocontents' => $vendorDir . '/mpdf/mpdf/classes/tocontents.php',

Bcmath.php (https://github.com/alvaropereyra/shrekcms.git) PHP · 206 lines

1 <?php

2 /**

3 * Zend Framework

26

27 /** Zend_Crypt_Math_BigInteger_Interface */

28 require_once 'Zend/Crypt/Math/BigInteger/Interface.php';

29

30 /**

31 * Support for arbitrary precision mathematics in PHP.

32 *

33 * Zend_Crypt_Math_BigInteger_Bcmath is a wrapper across the PHP BCMath

197 $return = '0';

198 while(strlen($hex)) {

199 $hex = hexdec(substr($operand, 0, 4));

200 $dec = bcadd(bcmul($return, 65536), $hex);

201 $operand = substr($operand, 4);

style_block.inc.php (https://gitlab.com/ogar.vasily/activetables) PHP · 307 lines

186

187 .wpDataTables .selecter .selecter-options {

188 border-radius: 0px 0px <?php echo $wdtBorderRadius ?>px <?php echo $wdtBorderRadius ?>px !important;

189 }

190

191 <?php echo $wdtSelecterRadius = $wdtBorderRadius-1 > 0 ? $wdtBorderRadius-1 : 0; ?>

192 .wpDataTables .selecter .selecter-item:last-child {

193 border-radius: 0px 0px <?php echo $wdtSelecterRadius ?>px <?php echo $wdtSelecterRadius ?>px !important;

194 }

195 <?php } ?>

297 .remodal-overlay,

298 .wpDataTablesWrapper .picker--opened .picker__holder {

299 background-color: rgba(<?php echo (int)$overlayR ?>,<?php echo (int)$overlayG ?>,<?php echo (int)$overlayB ?>,0.8) !important;

300 }

301 <?php } ?>

WcswidthDataGenerator.php (https://github.com/stof/symfony.git) PHP · 113 lines

1 <?php

2

3 /*

51 }

52

53 $this->write('wcswidth_table_wide.php', $version, $matches);

54 }

55

66 }

67

68 $this->write('wcswidth_table_zero.php', $version, $matches);

69 }

70

102 $end = $row[2] ?? $start;

103

104 return [hexdec($start), hexdec($end)];

105 }, $rawData);

106

io.h (https://gitlab.com/nexxuz/cryptonote) C Header · 107 lines

1 // Copyright (c) 2011-2014 The Cryptonote developers

2 // Distributed under the MIT/X11 software license, see the accompanying

3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.

4

5 #include <cstddef>

9 #include <vector>

10

11 inline bool hexdecode(const char *from, std::size_t length, void *to) {

12 std::size_t i;

13 for (i = 0; i < length; i++) {

54 std::string sres;

55 input >> sres;

56 if (sres.length() != 2 * length || !hexdecode(sres.data(), length, res)) {

57 input.setstate(std::ios_base::failbit);

58 }

Image.php (https://gitlab.com/habracoder/serv) PHP · 208 lines

1 <?php

2 namespace AppBundle\Services;

3

200 }

201

202 $r = hexdec($r);

203 $g = hexdec($g);

204 $b = hexdec($b);

205

206 return array($r, $g, $b);

UuidFactory.php (https://gitlab.com/madwanz64/laravel) PHP · 315 lines

1 <?php

2 /**

3 * This file is part of the ramsey/uuid library

300 {

301 $timeHi = BinaryUtils::applyVersion(substr($hash, 12, 4), $version);

302 $clockSeqHi = BinaryUtils::applyVariant(hexdec(substr($hash, 16, 2)));

303

304 $fields = [

UuidFactory.php (https://gitlab.com/codegod/evricommunity) PHP · 292 lines

1 <?php

2 /**

3 * This file is part of the ramsey/uuid library

277 {

278 $timeHi = BinaryUtils::applyVersion(substr($hash, 12, 4), $version);

279 $clockSeqHi = BinaryUtils::applyVariant(hexdec(substr($hash, 16, 2)));

280

281 $fields = array(

BitString.php (https://github.com/CloCkWeRX/Pyrus.git) PHP · 109 lines

1 <?php

2 /**

3 * \Pyrus\DER\BitString

4 *

5 * PHP version 5

6 *

7 * @category Pyrus

8 * @package Pyrus

9 * @author Greg Beaver <cellog@php.net>

10 * @copyright 2010 The PEAR Group

11 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License

18 * @category Pyrus

19 * @package Pyrus

20 * @author Greg Beaver <cellog@php.net>

21 * @copyright 2010 The PEAR Group

22 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License

function.getrandmax.html (https://bitbucket.org/thncr/manuals.git) HTML · 56 lines

8 <body><div class="manualnavbar" style="text-align: center;">

9 <div class="prev" style="text-align: left; float: left;"><a href="function.fmod.html">fmod</a></div>

10 <div class="next" style="text-align: right; float: right;"><a href="function.hexdec.html">hexdec</a></div>

11 <div class="up"><a href="ref.math.html">Math 函数</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

14 <div class="refnamediv">

15 <h1 class="refname">getrandmax</h1>

16 <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">getrandmax</span> &mdash; <span class="dc-title">显示随机数最大的可能值</span></p>

17

18 </div>

51 </div><hr /><div class="manualnavbar" style="text-align: center;">

52 <div class="prev" style="text-align: left; float: left;"><a href="function.fmod.html">fmod</a></div>

53 <div class="next" style="text-align: right; float: right;"><a href="function.hexdec.html">hexdec</a></div>

54 <div class="up"><a href="ref.math.html">Math 函数</a></div>

55 <div class="home"><a href="index.html">PHP Manual</a></div>

colour.js (https://gitlab.com/Drulenium-test/pantheon-travis) JavaScript · 105 lines

20

21 /**

22 * @fileoverview Generating PHP for colour blocks.

23 * @author daarond@gmail.com (Daaron Dwyer)

24 */

25 'use strict';

26

27 goog.provide('Blockly.PHP.colour');

28

29 goog.require('Blockly.PHP');

30

31

32 Blockly.PHP['colour_picker'] = function(block) {

33 // Colour picker.

34 var code = '\'' + block.getFieldValue('COLOUR') + '\'';

Drawing.php (https://gitlab.com/imamul68e/137619_PHP31) PHP · 237 lines

1 <?php

2 /**

3 * This file is part of PHPOffice Common

4 *

5 * PHPOffice Common is free software distributed under the terms of the GNU Lesser

6 * General Public License version 3 as published by the Free Software Foundation.

7 *

8 * For the full copyright and license information, please read the LICENSE

9 * file that was distributed with this source code. For the full list of

10 * contributors, visit https://github.com/PHPOffice/PHPWord/contributors.

11 *

12 * @link https://github.com/PHPOffice/Common

13 * @copyright 2009-2016 PHPOffice Common contributors

14 * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3

15 */

test_ext_math.h (https://github.com/kevlund/hiphop-php.git) C Header · 82 lines

1 /*

2 +----------------------------------------------------------------------+

3 | HipHop for PHP |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |

6 +----------------------------------------------------------------------+

7 | This source file is subject to version 3.01 of the PHP license, |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

12 | obtain it through the world-wide-web, please send a note to |

13 | license@php.net so we can mail you a copy immediately. |

14 +----------------------------------------------------------------------+

15 */

math_functions.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 154 lines

1 <?php

2 /**

3 * File containing the ezcTemplateMathFunctions class

18 {

19 /**

20 * Translates a function used in the Template language to a PHP function call.

21 * The function call is represented by an array with three elements:

22 *

124

125 // hex_to_dec( $s )::

126 // hexdec( $s )

127 case "math_hex_to_dec": return array( array( "%string" ),

128 self::functionCall( "hexdec", array( "%string") ) );

UUID.php (https://gitlab.com/michaelardian-dev/soccerStadiumReservation) PHP · 154 lines

1 <?php

2 /**

3 * UUID class

8 * UUIDs generated validates using OSSP UUID Tool, and output

9 * for named-based UUIDs are exactly the same. This is a pure

10 * PHP implementation.

11 *

12 * @author Andrew Moore

13 * @link http://www.php.net/manual/en/function.uniqid.php#94959

14 */

15 class UUID

38 for($i = 0; $i < strlen($nhex); $i+=2)

39 {

40 $nstr .= chr(hexdec($nhex[$i].$nhex[$i+1]));

41 }

42

UUID.class.php (https://github.com/Gamepay/xp-contrib.git) PHP · 143 lines

1 <?php

2 /* This class is part of the XP framework

3 *

70 $uuid->clock_seq_hi_and_reserved |= 0x80;

71

72 $h= md5(php_uname());

73 $uuid->node= array(

74 hexdec(substr($h, 0x0, 2)),

75 hexdec(substr($h, 0x2, 2)),

76 hexdec(substr($h, 0x4, 2)),

77 hexdec(substr($h, 0x6, 2)),

78 hexdec(substr($h, 0x8, 2)),

79 hexdec(substr($h, 0xB, 2))

80 );

81

iso_8859_9.php (https://github.com/BenBE/ispCP.git) PHP · 148 lines

1 <?php

2

3 /**

8 *

9 * @copyright 2004-2011 The SquirrelMail Project Team

10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License

11 * @version $Id: iso_8859_9.php 14084 2011-01-06 02:44:03Z pdontthink $

24

25 $string=preg_replace("/&#([0-9]+);/e","unicodetoiso88599('\\1')",$string);

26 // $string=preg_replace("/&#[xX]([0-9A-F]+);/e","unicodetoiso88599(hexdec('\\1'))",$string);

27

28 return $string;

34 * This function is used internally by charset_encode_iso_8859_9

35 * function. It might be unavailable to other SquirrelMail functions.

36 * Don't use it or make sure, that functions/encode/iso_8859_9.php is

37 * included.

38 *

image.php (https://github.com/arastta/arastta.git) PHP · 202 lines

1 <?php

2 /**

3 * @package Arastta eCommerce

194 }

195

196 $r = hexdec($r);

197 $g = hexdec($g);

198 $b = hexdec($b);

199

200 return array($r, $g, $b);

Gmp.php (https://github.com/mfairchild365/zf2.git) PHP · 205 lines

1 <?php

2 /**

3 * Zend Framework

26

27 /**

28 * Support for arbitrary precision mathematics in PHP.

29 *

30 * Zend_Crypt_Math_BigInteger_Bcmath is a wrapper across the PHP BCMath

197 $return = '0';

198 while(strlen($hex)) {

199 $hex = hexdec(substr($operand, 0, 4));

200 $dec = gmp_add(gmp_mul($return, 65536), $hex);

201 $operand = substr($operand, 4);

PhpStringTokenParser.php (https://gitlab.com/Marwamimo/Crowdrise_Web) PHP · 142 lines

1 <?php

2

3 /*

13

14 /*

15 * The following is derived from code at http://github.com/nikic/PHP-Parser

16 *

17 * Copyright (c) 2011 by Nikita Popov

48 */

49

50 class PhpStringTokenParser

51 {

52 protected static $replacements = array(

114 return self::$replacements[$str];

115 } elseif ('x' === $str[0] || 'X' === $str[0]) {

116 return chr(hexdec($str));

117 } else {

118 return chr(octdec($str));

math_misc.php (https://gitlab.com/iranjith4/hhvm) PHP · 82 lines

1 <?php

2

3 function VC($x, $y) {

27 var_dump(bindec("111"));

28

29 var_dump(hexdec("See"));

30 var_dump(hexdec("ee"));

31 var_dump(hexdec("that"));

32 var_dump(hexdec("a0"));

Unescaper.php (https://gitlab.com/fabiorf/chat) PHP · 141 lines

1 <?php

2

3 /*

110 return "\xE2\x80\xA9";

111 case 'x':

112 return self::utf8chr(hexdec(substr($value, 2, 2)));

113 case 'u':

114 return self::utf8chr(hexdec(substr($value, 2, 4)));

115 case 'U':

116 return self::utf8chr(hexdec(substr($value, 2, 8)));

117 }

118 }

convert.py (https://bitbucket.org/acaceres/mr-injector.git) Python · 182 lines

62 return pickle.loads(base64decode(value))

63

64 def hexdecode(value):

65 """

66 Decodes string value from hex to plain format

67

68 >>> hexdecode('666f6f626172')

69 'foobar'

70 """

Text.php (https://gitlab.com/habracoder/advertising) PHP · 155 lines

1 <?php

2

3 namespace Phalcon;

16

17

18 const RANDOM_HEXDEC = 2;

19

20

HashProvider.class.php (https://github.com/oanas/xp-framework.git) PHP · 95 lines

1 <?php

2 /* This class is part of the XP framework

3 *

36 self::$instance= new self();

37

38 // Workaround for bugs in older PHP versions, see MD5HexHashImplementation's

39 // class apidoc for an explanation. Earlier versions returned LONG_MAX for

40 // hex numbers larger than LONG_MAX. Use 2^64 + 1 as hex literal and see if

41 // it's "truncated", using the slower hexdec(md5()) implementation then.

42 if (LONG_MAX === @0x20c49ba5e35423) {

43 $impl= XPClass::forName('util.collections.MD5HexHashImplementation')->newInstance();

Ip.php (https://github.com/leerbag/zf2.git) PHP · 207 lines

1 <?php

2 /**

3 * Zend Framework

156 } else if (preg_match('/^([0-9a-f]{2}.){3}[0-9a-f]{2}$/i', $value)) {

157 // hex format ff.ff.ff.ff

158 $value = hexdec(substr($value, 0, 2)) . "." . hexdec(substr($value, 3, 2)) . "."

159 . hexdec(substr($value, 6, 2)) . "." . hexdec(substr($value, 9, 2));

Color.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 230 lines

1 <?php

2

3 /**

27 }else if( strlen($rgb) == 6 ){

28 foreach(str_split($rgb, 2) as $c){

29 $this->rgb[] = hexdec($c);

30 }

31 }else{

32 foreach(str_split($rgb, 1) as $c){

33 $this->rgb[] = hexdec($c.$c);

34 }

35 }

Utf8CaseGenerate.php (https://github.com/maedca/mozillavenezuela.git) PHP · 112 lines

1 <?php

2 # Copyright (C) 2004,2008 Brion Vibber <brion@pobox.com>

3 # http://www.mediawiki.org/

28 /** */

29

30 if( php_sapi_name() != 'cli' ) {

31 die( "Run me from the command line please.\n" );

32 }

33

34 require_once 'UtfNormalUtil.php';

35

36 $in = fopen("UnicodeData.txt", "rt" );

52 $simpleLower = $columns[13];

53

54 $source = codepointToUtf8( hexdec( $codepoint ) );

55 if( $simpleUpper ) {

56 $wikiUpperChars[$source] = codepointToUtf8( hexdec( $simpleUpper ) );

LNumber.php (https://github.com/linuxserver/Heimdall.git) PHP · 71 lines

1 <?php declare(strict_types=1);

2

3 namespace PhpParser\Node\Scalar;

4

5 use PhpParser\Error;

6 use PhpParser\Node\Scalar;

37 * @param string $str String number literal (decimal, octal, hex or binary)

38 * @param array $attributes Additional attributes

39 * @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5)

40 *

41 * @return LNumber The constructed LNumber, including kind attribute

49 if ('x' === $str[1] || 'X' === $str[1]) {

50 $attributes['kind'] = LNumber::KIND_HEX;

51 return new LNumber(hexdec($str), $attributes);

52 }

53