mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
26 lines
588 B
JavaScript
26 lines
588 B
JavaScript
(function (store) {
|
|
|
|
MediaBrowser.ApiClient.generateDeviceId = function () {
|
|
|
|
var keys = [];
|
|
|
|
keys.push(navigator.userAgent);
|
|
keys.push((navigator.cpuClass || ""));
|
|
|
|
var randomId = '';
|
|
|
|
// Since the above is not guaranteed to be unique per device, add a little more
|
|
randomId = store.getItem('randomId');
|
|
|
|
if (!randomId) {
|
|
|
|
randomId = new Date().getTime();
|
|
|
|
store.setItem('randomId', randomId.toString());
|
|
}
|
|
|
|
keys.push(randomId);
|
|
return sha1(keys.join('|'));
|
|
};
|
|
|
|
})(store); |