UNPKG
occaecatidicta
Version:
latest (1.0.0)
1.0.0
github.com/MyleneMcClure/occaecatidicta.git
MyleneMcClure/occaecatidicta
occaecatidicta
/
examples
/
websocket-chat
/
game-server
/
app
/
util
/
dispatcher.ts
7 lines
(6 loc)
•
226 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
*
as
crc
from
'crc'
;
import
{
ServerInfo
}
from
'omelox'
;
export
function
dispatch
(
uid: string , connectors: ServerInfo[]
) {
let
index =
Math
.
abs
(crc.
crc32
(uid)) % connectors.
length
;
return
connectors[index]; }