mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
* add unit tests for websocket events * add unit tests for KeepAliveService, clean up keepAlive termination flow * put keepAlive command in protobuf service and expose thru webClient * secure wss * rename files tsx to ts * add localhost support for ws/wss connection Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
8 lines
No EOL
244 B
TypeScript
8 lines
No EOL
244 B
TypeScript
function s4(): string {
|
|
const s4 = Math.floor((1 + Math.random()) * 0x10000);
|
|
return s4.toString(16).substring(1);
|
|
}
|
|
|
|
export function guid(): string {
|
|
return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4();
|
|
} |