Skip to content

Commit 4e802f1

Browse files
authored
Update index.js
1 parent 854b0cd commit 4e802f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/core/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ const Resolver = {
9090
}
9191
}
9292

93+
// add the randomUUID option to crypto
94+
window.crypto.randomUUID = function () {
95+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
96+
.replace(/[xy]/g, function (c) {
97+
const r = Math.random() * 16 | 0,
98+
v = c == 'x' ? r : (r & 0x3 | 0x8);
99+
return v.toString(16);
100+
});
101+
}
102+
93103
export {
94104
Attachment,
95105
When,

0 commit comments

Comments
 (0)