mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2026-04-18 06:10:01 +00:00
Generate a unique remote input key per connection. This closes #54
This commit is contained in:
@@ -12,6 +12,17 @@ function uniqueid() {
|
||||
});
|
||||
}
|
||||
|
||||
function generateRemoteInputKey() {
|
||||
return 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.replace(/[x]/g, function(c) {
|
||||
var r = Math.random()*16|0;
|
||||
return r.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
function generateRemoteInputKeyId() {
|
||||
return ((Math.random()-0.5) * 0x7FFFFFFF)|0;
|
||||
}
|
||||
|
||||
String.prototype.toHex = function() {
|
||||
var hex = '';
|
||||
for(var i = 0; i < this.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user