-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #620 from nearbeach/develop
Hotfix - issue with crypto.randomUUID not working on http
- Loading branch information
Showing
11 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+25 Bytes
(100%)
NearBeach/static/NearBeach/diagnostic-information.min.js.gz
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export function getRandomID() { | ||
//If crypto.randomUUID works on browser - use that by default | ||
if (crypto.randomUUID !== undefined) return crypto.randomUUID(); | ||
|
||
//Cryptop Random UUID did not work - default is to manually create uuid | ||
let results = ""; | ||
const characters = "abcdefghijklmnopqrstuvwxyz0123456789"; | ||
|
||
//Loop through to create random 6 string | ||
for (let i = 0; i < 6; i++) { | ||
results += characters.charAt( | ||
Math.floor(Math.random() * characters.length) | ||
); | ||
} | ||
|
||
//Return our random string | ||
return results; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters