mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
vulcanize
This commit is contained in:
parent
07df993238
commit
55e40bdcf7
52 changed files with 12309 additions and 33 deletions
33
dashboard-ui/apiclient/device.js
Normal file
33
dashboard-ui/apiclient/device.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
(function (globalScope) {
|
||||
|
||||
if (!globalScope.MediaBrowser) {
|
||||
globalScope.MediaBrowser = {};
|
||||
}
|
||||
|
||||
globalScope.MediaBrowser.generateDeviceId = function (keyName, seed) {
|
||||
|
||||
var keys = [];
|
||||
|
||||
keys.push(navigator.userAgent);
|
||||
keys.push((navigator.cpuClass || ""));
|
||||
|
||||
if (seed) {
|
||||
keys.push(seed);
|
||||
}
|
||||
var randomId = '';
|
||||
|
||||
// Since the above is not guaranteed to be unique per device, add a little more
|
||||
randomId = appStorage.getItem(keyName);
|
||||
|
||||
if (!randomId) {
|
||||
|
||||
randomId = new Date().getTime();
|
||||
|
||||
appStorage.setItem(keyName, randomId.toString());
|
||||
}
|
||||
|
||||
keys.push(randomId);
|
||||
return CryptoJS.SHA1(keys.join('|')).toString();
|
||||
};
|
||||
|
||||
})(window);
|
Loading…
Add table
Add a link
Reference in a new issue