Mercurial > hg > isophonics-drupal-site
comparison vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children | c2387f117808 |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
68 if ($bytes > 2147483647) { | 68 if ($bytes > 2147483647) { |
69 for ($i = 0; $i < $bytes; $i += 1073741824) { | 69 for ($i = 0; $i < $bytes; $i += 1073741824) { |
70 $n = ($bytes - $i) > 1073741824 | 70 $n = ($bytes - $i) > 1073741824 |
71 ? 1073741824 | 71 ? 1073741824 |
72 : $bytes - $i; | 72 : $bytes - $i; |
73 $buf .= Sodium::randombytes_buf($n); | 73 $buf .= Sodium::randombytes_buf((int) $n); |
74 } | 74 } |
75 } else { | 75 } else { |
76 $buf .= Sodium::randombytes_buf($bytes); | 76 $buf .= Sodium::randombytes_buf((int) $bytes); |
77 } | 77 } |
78 | 78 |
79 if (is_string($buf)) { | 79 if (is_string($buf)) { |
80 if (RandomCompat_strlen($buf) === $bytes) { | 80 if (RandomCompat_strlen($buf) === $bytes) { |
81 return $buf; | 81 return $buf; |