<doc>
	<legacy_id></legacy_id>
	<name>randomBytes</name>
	<type>function</type>

	<syntax>
		<example>randomBytes(<i>byteCount</i>)</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Returns <i>byteCount</i> random bytes.</summary>

	<examples>
<example>randomBytes(10)</example>
<example>randomBytes(the number of characters of myVar)</example>
	</examples>

	<history>
		<introduced version="4.6">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Math, Logic, &amp; Dates</category>
	</classification>

	<references>
    <property tag="randomSeed">randomSeed Property</property>
    <function tag="random">random Function</function>
	</references>

	<description>
	<overview>Use the <b>randomBytes</b> function to generate cryptographic-quality random data.</overview>

		<parameters>
		<parameter>The <i>byteCount</i> is a number specifying how many random bytes to generate.</parameter>
		</parameters>

	<value>The <b>randomBytes</b> function returns <i>byteCount</i> random bytes.</value>
	<comments>The <b>randomBytes</b> function returns <i>byteCount</i> random bytes using the OpenSSL library's random data generator to do so.<p></p><p>The random data is derived from non-predictable sources where possible, meaning that it can (for the most part) be considered truly random. This is contrast to the <function tag="random">random</function> function which uses a pseudo-random number generator and <property tag="randomSeed">randomSeed</property> value.</p><p></p><p></p><note>Make sure the security library is included when building applications that use this function as a standalone. If the library cannot be found at runtime, the function with throw an error.</note></comments>
	</description>
</doc>