aboutsummaryrefslogtreecommitdiff
path: root/files/nl/web/api/window.crypto.getrandomvalues/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
commit074785cea106179cb3305637055ab0a009ca74f2 (patch)
treee6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/nl/web/api/window.crypto.getrandomvalues/index.html
parentda78a9e329e272dedb2400b79a3bdeebff387d47 (diff)
downloadtranslated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz
translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2
translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip
initial commit
Diffstat (limited to 'files/nl/web/api/window.crypto.getrandomvalues/index.html')
-rw-r--r--files/nl/web/api/window.crypto.getrandomvalues/index.html97
1 files changed, 97 insertions, 0 deletions
diff --git a/files/nl/web/api/window.crypto.getrandomvalues/index.html b/files/nl/web/api/window.crypto.getrandomvalues/index.html
new file mode 100644
index 0000000000..c91a691be9
--- /dev/null
+++ b/files/nl/web/api/window.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 &lt; 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>