mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 09:52:17 +01:00
125 lines
3.3 KiB
XML
Executable File
125 lines
3.3 KiB
XML
Executable File
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 7f99d5e488d161ce3b12d1dae405a283728933c3 Maintainer: girgias Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="function.random-int" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>random_int</refname>
|
|
<refpurpose>Génère des nombres entiers pseudo-aléatoire cryptographiquement sécurisé</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description"><!-- {{{ -->
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>random_int</methodname>
|
|
<methodparam><type>int</type><parameter>min</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>max</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
|
|
Génère un &integer; aléatoires cryptographiques qui convient à un usage où
|
|
des résultats impartial sont critique, comme lors d'un mélange d'un paquet de
|
|
cartes pour une partie de poker.
|
|
</para>
|
|
&csprng.sources;
|
|
&csprng.function.backport;
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="parameters"><!-- {{{ -->
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>min</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La valeur minimale à retourner, qui doit être
|
|
<constant>PHP_INT_MIN</constant> ou supérieur.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>max</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La valeur maximale à retourner, qui doit être moins
|
|
ou égal à <constant>PHP_INT_MAX</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="returnvalues"><!-- {{{ -->
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne un nombre entier pseudo-aléatoire cryptographiquement sécurisé dans
|
|
l'intervale entre <parameter>min</parameter> et <parameter>max</parameter> inclus.
|
|
</para>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="errors"><!-- {{{ -->
|
|
&reftitle.errors;
|
|
<itemizedlist>
|
|
&csprng.errors;
|
|
<listitem>
|
|
<simpara>
|
|
Si <parameter>max</parameter> est moins que <parameter>min</parameter>,
|
|
une <classname>Error</classname> sera lancée.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="examples"><!-- {{{ -->
|
|
&reftitle.examples;
|
|
<example xml:id="random-int.example.basic"><!-- {{{ -->
|
|
<title>Exemple avec <function>random_int</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
var_dump(random_int(100, 999));
|
|
var_dump(random_int(-1000, 0));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
int(248)
|
|
int(-898)
|
|
]]>
|
|
</screen>
|
|
</example><!-- }}} -->
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="seealso"><!-- {{{ -->
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>random_bytes</function></member>
|
|
</simplelist>
|
|
</refsect1><!-- }}} -->
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|