-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathindex.md
More file actions
47 lines (30 loc) · 1.06 KB
/
index.md
File metadata and controls
47 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: "Crypto: randomUUID() Methode"
short-title: randomUUID()
slug: Web/API/Crypto/randomUUID
l10n:
sourceCommit: cc27a64bb555b250cf0984a3a744e5fd251e3565
---
{{APIRef("Web Crypto API")}}{{SecureContext_header}}{{AvailableInWorkers}}
Die **`randomUUID()`** Methode des [`Crypto`](/de/docs/Web/API/Crypto) Interfaces wird verwendet, um eine v4 {{Glossary("UUID", "UUID")}} mit einem kryptographisch sicheren Zufallszahlengenerator zu erzeugen.
## Syntax
```js-nolint
randomUUID()
```
### Parameter
Keine.
### Rückgabewert
Ein String, der eine zufällig generierte, 36 Zeichen lange v4 UUID enthält.
## Beispiele
```js
/* Assuming that self.crypto.randomUUID() is available */
let uuid = self.crypto.randomUUID();
console.log(uuid); // for example "36b8f84d-df4e-4d49-b662-bcde71a8764f"
```
## Spezifikationen
{{Specifications}}
## Browser-Kompatibilität
{{Compat}}
## Siehe auch
- [Web Crypto API](/de/docs/Web/API/Web_Crypto_API)
- [`Crypto.getRandomValues`](/de/docs/Web/API/Crypto/getRandomValues), eine Quelle für beliebige Mengen sicherer Zufallsbytes.