We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a78f162 commit 929f4fbCopy full SHA for 929f4fb
2 files changed
src/utils/uuid.ts
@@ -4,9 +4,9 @@ export function generateUUID(): string {
4
}
5
6
// Fallback (non cryptographique)
7
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c: string) {
8
- const r = (Math.random() * 16) | 0;
9
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c: string): string {
+ const r = Math.floor(Math.random() * 16); // évite l'opérateur bitwise
+ const v = c === 'x' ? r : (r % 4) + 8; // remplace (r & 0x3 | 0x8)
10
return v.toString(16);
11
});
12
tslint.json
@@ -14,7 +14,7 @@
14
"label-position": true,
15
"no-any": true,
16
"no-arg": true,
17
- "no-bitwise": false,
+ "no-bitwise": true,
18
"no-console": [
19
false,
20
"log",
0 commit comments