mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-09 18:10:29 +00:00
feat: extension support (#78)
This commit is contained in:
118 files changed
+6971
-780
No files matched your search
@@ -0,0 +1,13 @@
|
||||
globalThis.crypto = {
|
||||
getRandomValues(arr) {
|
||||
for (let i = 0, len = arr.length; i < len; i++) {
|
||||
arr[i] = Math.floor(Math.random() * 256);
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
randomUUID() {
|
||||
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => {
|
||||
return (c ^ (this.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user