diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 14:48:47 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 14:48:47 +0100 |
commit | 004b3c5fc8d71b68fcb019c9e0346bf80024dbbd (patch) | |
tree | da24dacd9c5017e318f84563381671b5bdfb3e47 /files/nl/web/api/crypto/getrandomvalues/index.html | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-004b3c5fc8d71b68fcb019c9e0346bf80024dbbd.tar.gz translated-content-004b3c5fc8d71b68fcb019c9e0346bf80024dbbd.tar.bz2 translated-content-004b3c5fc8d71b68fcb019c9e0346bf80024dbbd.zip |
unslug nl: move
Diffstat (limited to 'files/nl/web/api/crypto/getrandomvalues/index.html')
-rw-r--r-- | files/nl/web/api/crypto/getrandomvalues/index.html | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/files/nl/web/api/crypto/getrandomvalues/index.html b/files/nl/web/api/crypto/getrandomvalues/index.html new file mode 100644 index 0000000000..c91a691be9 --- /dev/null +++ b/files/nl/web/api/crypto/getrandomvalues/index.html @@ -0,0 +1,97 @@ +--- +title: window.crypto.getRandomValues +slug: Web/API/window.crypto.getRandomValues +translation_of: Web/API/Crypto/getRandomValues +--- +<p>{{ ApiRef() }}</p> +<p>{{ SeeCompatTable() }}</p> +<p>Met deze functie kunt u cryptografisch willekeurige getallen verkrijgen.</p> +<h2 id="Syntax">Syntax</h2> +<pre class="syntaxbox">window.crypto.getRandomValues(typedArray);</pre> +<h2 id="Parameters">Parameters</h2> +<table class="standard-table" style=""> + <thead> + <tr> + <th scope="col">Parameter</th> + <th scope="col">Description</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>typedArray</code></td> + <td>Integer-gebaseerde <a href="/en/JavaScript_typed_arrays" title="JavaScript typed arrays">TypedArray</a>. Alle elementen in de array zullen worden overschreven door willekeurige getallen.</td> + </tr> + </tbody> +</table> +<h2 id="Beschrijving">Beschrijving</h2> +<p>Als u een integer-gebaseerde <a href="/en/JavaScript_typed_arrays" title="JavaScript typed arrays">TypedArray</a> (d.w.z. een <a href="/en/JavaScript_typed_arrays/Int8Array" title="Int8Array"><code>Int8Array</code></a>, <a href="/en/JavaScript_typed_arrays/Uint8Array" title="Uint8Array"><code>Uint8Array</code></a>, <a href="/en/JavaScript_typed_arrays/Int16Array" title="Int16Array"><code>Int16Array</code></a>, <a href="/en/JavaScript_typed_arrays/Uint16Array" title="Uint16Array"><code>Uint16Array</code></a>, <a href="/en/JavaScript_typed_arrays/Int32Array" title="Int32Array"><code>Int32Array</code></a>, of <a href="/en/JavaScript_typed_arrays/Uint32Array" title="Uint32Array"><code>Uint32Array</code></a>) meegeeft, zal de functie de array vullen met cryptografisch willekeurige getallen. Het is de bedoeling dat de browser een sterke (pseudo)willekeurige getalsgenerator gebruikt. Omdat de browser waarschijnlijk slechts een beperkte hoeveelheid entropie heeft, mag de methode een <code>QuotaExceededError</code> geven, als teveel entropie wordt gebruikt.</p> +<h2 id="Voorbeeld">Voorbeeld</h2> +<pre class="brush: js">/* ervanuit gaande dat that window.crypto.getRandomValues beschikbaar is */ + +var array = new Uint32Array(10); +window.crypto.getRandomValues(array); + +console.log("Uw geluksnummers:"); +for (var i = 0; i < array.length; i++) { + console.log(array[i]); +} +</pre> +<h2 id="Browsercompatibiliteit">Browsercompatibiliteit</h2> +<p>{{ CompatibilityTable() }}</p> +<div id="compat-desktop"> + <table class="compat-table"> + <tbody> + <tr> + <th>Kenmerk</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basisondersteuning</td> + <td>11.0 {{ webkitbug("22049") }}</td> + <td>21.0</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>3.1</td> + </tr> + </tbody> + </table> +</div> +<div id="compat-mobile"> + <table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android Browser</th> + <th>Chrome (as App)</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatNo() }}</td> + <td>23</td> + <td>21.0</td> + <td>{{ CompatNo() }}</td> + <td>{{ CompatNo() }}</td> + <td>iOS 6</td> + </tr> + </tbody> + </table> +</div> +<h2 id="Specification" name="Specification">Specificatie</h2> +<ul> + <li><a class="external" href="http://wiki.whatwg.org/wiki/Crypto" title="http://wiki.whatwg.org/wiki/Crypto">WHATWG window.crypto proposal</a></li> + <li><a href="http://www.w3.org/TR/WebCryptoAPI/" title="http://www.w3.org/TR/WebCryptoAPI/">Web Cryptography API</a></li> +</ul> +<h2 id="See_also">See also</h2> +<ul> + <li>{{ domxref("Window.crypto") }}</li> + <li><a href="/en/JavaScript_crypto" title="JavaScript crypto">JavaScript crypto</a></li> + <li><a href="/en/JavaScript/Reference/Global_Objects/Math/random" title="random">Math.random</a></li> +</ul> |