Created
June 20, 2020 17:04
-
-
Save dmnsgn/753f97ed4a7cebd2bae8c3bcce88473d to your computer and use it in GitHub Desktop.
Standalone UUID generator in Javascript: https://abhishekdutta.org/blog/standalone_uuid_generator_in_javascript.html
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
// Author: Abhishek Dutta, 12 June 2020 | |
// License: CC0 (https://creativecommons.org/choose/zero/) | |
export default function uuid() { | |
var temp_url = URL.createObjectURL(new Blob()); | |
var uuid = temp_url.toString(); | |
URL.revokeObjectURL(temp_url); | |
return uuid.substr(uuid.lastIndexOf('/') + 1); // remove prefix (e.g. blob:null/, blob:www.test.com/, ...) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment