Last active
January 30, 2018 20:46
-
-
Save DaMandal0rian/d9a996b9d33a1f662cd644cacbd89265 to your computer and use it in GitHub Desktop.
Revisions
-
Muhammad Perreira revised this gist
Jan 30, 2018 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,11 +19,20 @@ function generate_guid() { }); } function get_local_guid() { if (window.localStorage.guid != null) { return window.localStorage.guid; } else { window.localStorage.guid = generate_guid(); return window.localStorage.guid; } } function get_session_guid() { if (window.sessionStorage.getItem("guid") != null) { return window.sessionStorage.getItem("guid"); } else { window.sessionStorage.setItem("guid", generate_guid()); return window.sessionStorage.getItem("guid"); } } -
Muhammad Perreira created this gist
Jan 30, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ var brwsr_guid = function() { var nav = window.navigator; var screen = window.screen; var guid = nav.mimeTypes.length; guid += nav.userAgent.replace(/\D+/g, ''); guid += nav.plugins.length; guid += screen.height || ''; guid += screen.width || ''; guid += screen.pixelDepth || ''; return guid; }; function generate_guid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16); }); } function get_guid() { if (window.localStorage.guid != null) { return window.localStorage.guid; } else { window.localStorage.guid = generate_guid(); return window.localStorage.guid; } }