$63 GRAYBYTE WORDPRESS FILE MANAGER $11

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/php74/usr/include/php/ext/standard/

HOME
Current File : /opt/alt/php74/usr/include/php/ext/standard//php_rand.h
/*
   +----------------------------------------------------------------------+
   | PHP Version 7                                                        |
   +----------------------------------------------------------------------+
   | Copyright (c) The PHP Group                                          |
   +----------------------------------------------------------------------+
   | This source file is subject to version 3.01 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.php.net/license/3_01.txt                                  |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Authors: Rasmus Lerdorf <rasmus@php.net>                             |
   |          Zeev Suraski <zeev@php.net>                                 |
   |          Pedro Melo <melo@ip.pt>                                     |
   |          Sterling Hughes <sterling@php.net>                          |
   |                                                                      |
   | Based on code from: Shawn Cokus <Cokus@math.washington.edu>          |
   +----------------------------------------------------------------------+
 */

#ifndef PHP_RAND_H
#define	PHP_RAND_H

#include "php_lcg.h"
#include "php_mt_rand.h"

/* System Rand functions */
#ifndef RAND_MAX
#define RAND_MAX PHP_MT_RAND_MAX
#endif

#define PHP_RAND_MAX PHP_MT_RAND_MAX

/*
 * A bit of tricky math here.  We want to avoid using a modulus because
 * that simply tosses the high-order bits and might skew the distribution
 * of random values over the range.  Instead we map the range directly.
 *
 * We need to map the range from 0...M evenly to the range a...b
 * Let n = the random number and n' = the mapped random number
 *
 * Then we have: n' = a + n(b-a)/M
 *
 * We have a problem here in that only n==M will get mapped to b which
 # means the chances of getting b is much much less than getting any of
 # the other values in the range.  We can fix this by increasing our range
 # artificially and using:
 #
 #               n' = a + n(b-a+1)/M
 *
 # Now we only have a problem if n==M which would cause us to produce a
 # number of b+1 which would be bad.  So we bump M up by one to make sure
 # this will never happen, and the final algorithm looks like this:
 #
 #               n' = a + n(b-a+1)/(M+1)
 *
 * -RL
 */
#define RAND_RANGE_BADSCALING(__n, __min, __max, __tmax) \
	(__n) = (__min) + (zend_long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / ((__tmax) + 1.0)))

#ifdef PHP_WIN32
#define GENERATE_SEED() (((zend_long) (time(0) * GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg())))
#else
#define GENERATE_SEED() (((zend_long) (time(0) * getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg())))
#endif

PHPAPI void php_srand(zend_long seed);
PHPAPI zend_long php_rand(void);

#endif	/* PHP_RAND_H */

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
13 Aug 2025 1.54 AM
root / 996
0755
base64.h
3.798 KB
9 Jul 2025 3.28 PM
root / 996
0644
basic_functions.h
7.712 KB
9 Jul 2025 3.28 PM
root / 996
0644
crc32.h
4.644 KB
9 Jul 2025 3.28 PM
root / 996
0644
credits.h
1.674 KB
9 Jul 2025 3.28 PM
root / 996
0644
credits_ext.h
5.246 KB
9 Jul 2025 3.28 PM
root / 996
0644
credits_sapi.h
0.815 KB
9 Jul 2025 3.28 PM
root / 996
0644
crypt_blowfish.h
1.013 KB
9 Jul 2025 3.28 PM
root / 996
0644
crypt_freesec.h
0.646 KB
9 Jul 2025 3.28 PM
root / 996
0644
css.h
1.193 KB
9 Jul 2025 3.28 PM
root / 996
0644
cyr_convert.h
1.225 KB
9 Jul 2025 3.28 PM
root / 996
0644
datetime.h
1.342 KB
9 Jul 2025 3.28 PM
root / 996
0644
dl.h
1.593 KB
9 Jul 2025 3.28 PM
root / 996
0644
exec.h
1.681 KB
9 Jul 2025 3.28 PM
root / 996
0644
file.h
4.631 KB
9 Jul 2025 3.28 PM
root / 996
0644
flock_compat.h
2.059 KB
9 Jul 2025 3.28 PM
root / 996
0644
fsock.h
1.416 KB
9 Jul 2025 3.28 PM
root / 996
0644
head.h
1.854 KB
9 Jul 2025 3.28 PM
root / 996
0644
hrtime.h
2.478 KB
9 Jul 2025 3.28 PM
root / 996
0644
html.h
2.623 KB
9 Jul 2025 3.28 PM
root / 996
0644
html_tables.h
472.411 KB
9 Jul 2025 3.28 PM
root / 996
0644
info.h
22.6 KB
9 Jul 2025 3.28 PM
root / 996
0644
md5.h
2.101 KB
9 Jul 2025 3.28 PM
root / 996
0644
microtime.h
1.321 KB
9 Jul 2025 3.28 PM
root / 996
0644
pack.h
1.237 KB
9 Jul 2025 3.28 PM
root / 996
0644
pageinfo.h
1.423 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_array.h
4.412 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_assert.h
1.384 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_browscap.h
1.284 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_crypt.h
1.539 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_crypt_r.h
1.993 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_dir.h
1.662 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_dns.h
2.962 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_ext_syslog.h
1.464 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_filestat.h
3.096 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_fopen_wrappers.h
1.942 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_ftok.h
1.223 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_http.h
1.616 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_image.h
2.368 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_incomplete_class.h
2.242 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_iptc.h
1.231 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_lcg.h
1.484 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_link.h
1.327 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_mail.h
2.372 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_math.h
4.646 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_metaphone.h
1.201 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_mt_rand.h
1.956 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_net.h
1.318 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_password.h
3.074 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_rand.h
3.144 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_random.h
2.073 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_smart_string.h
1.282 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_smart_string_public.h
1.289 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_standard.h
2.238 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_string.h
5.941 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_type.h
1.618 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_uuencode.h
1.377 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_var.h
3.608 KB
9 Jul 2025 3.28 PM
root / 996
0644
php_versioning.h
1.361 KB
9 Jul 2025 3.28 PM
root / 996
0644
proc_open.h
1.735 KB
9 Jul 2025 3.28 PM
root / 996
0644
quot_print.h
1.451 KB
9 Jul 2025 3.28 PM
root / 996
0644
scanf.h
2.242 KB
9 Jul 2025 3.28 PM
root / 996
0644
sha1.h
1.688 KB
9 Jul 2025 3.28 PM
root / 996
0644
streamsfuncs.h
2.729 KB
9 Jul 2025 3.28 PM
root / 996
0644
uniqid.h
1.231 KB
9 Jul 2025 3.28 PM
root / 996
0644
url.h
2.394 KB
9 Jul 2025 3.28 PM
root / 996
0644
url_scanner_ex.h
2.44 KB
9 Jul 2025 3.28 PM
root / 996
0644
winver.h
6.228 KB
9 Jul 2025 3.28 PM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF