PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.4
Booking for Appointments and Events Calendar – Amelia v2.4.4
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / stripe / stripe-php / lib / Util / RandomGenerator.php
ameliabooking / vendor / stripe / stripe-php / lib / Util Last commit date
ApiVersion.php 6 months ago CaseInsensitiveArray.php 6 months ago DefaultLogger.php 6 months ago EventTypes.php 6 months ago LoggerInterface.php 6 months ago ObjectTypes.php 6 months ago RandomGenerator.php 6 months ago RequestOptions.php 6 months ago Set.php 6 months ago Util.php 6 months ago
RandomGenerator.php
37 lines
1 <?php
2
3 namespace AmeliaVendor\Stripe\Util;
4
5 /**
6 * A basic random generator. This is in a separate class so we the generator
7 * can be injected as a dependency and replaced with a mock in tests.
8 */
9 class RandomGenerator
10 {
11 /**
12 * Returns a random value between 0 and $max.
13 *
14 * @param float $max (optional)
15 *
16 * @return float
17 */
18 public function randFloat($max = 1.0)
19 {
20 return \mt_rand() / \mt_getrandmax() * $max;
21 }
22
23 /**
24 * Returns a v4 UUID.
25 *
26 * @return string
27 */
28 public function uuid()
29 {
30 $arr = \array_values(\unpack('N1a/n4b/N1c', \openssl_random_pseudo_bytes(16)));
31 $arr[2] = ($arr[2] & 0x0FFF) | 0x4000;
32 $arr[3] = ($arr[3] & 0x3FFF) | 0x8000;
33
34 return \vsprintf('%08x-%04x-%04x-%04x-%04x%08x', $arr);
35 }
36 }
37