{"id":2184,"date":"2019-08-24T09:22:34","date_gmt":"2019-08-24T08:22:34","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=2184"},"modified":"2022-02-17T07:13:49","modified_gmt":"2022-02-17T07:13:49","slug":"random","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/random\/random","title":{"rendered":".Random"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">rand() function<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>$RandomValue = rand($MinValue, $MaxValue);<\/code><\/pre>\n\n\n\n<p>rand  does not generate cryptographically secure values, and should not be used for cryptographic purposes. <\/p>\n\n\n\n<p>Min and max are inclusive.<\/p>\n\n\n\n<p>mt_rand() used to be used in place of ran() because it was faster, but from PHP7.1 rand uses same as mt_rand.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Cryptographically secure random number generators<\/h4>\n\n\n\n<p>random_int()<\/p>\n\n\n\n<p>random_bytes()<\/p>\n\n\n\n<p>openssl_random_pseudo_bytes()<\/p>\n","protected":false},"excerpt":{"rendered":"<p>rand() function rand does not generate cryptographically secure values, and should not be used for cryptographic purposes. Min and max are inclusive. mt_rand() used to be used in place of ran() because it was faster, but from PHP7.1 rand uses same as mt_rand. Cryptographically secure random number generators random_int() random_bytes() openssl_random_pseudo_bytes()<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-2184","post","type-post","status-publish","format-standard","hentry","category-random"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=2184"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2184\/revisions"}],"predecessor-version":[{"id":3882,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/2184\/revisions\/3882"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=2184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=2184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=2184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}