Can I convert a unique string into a slightly shorter one without running into collision risks? Or if not, can I somehow create a new unique code that's much shorter?
I'm working with socket.io, and I wanted to use the socket id of the client who sets up a session as a code to be shared in order for others to join that session, however a code such as Kf-uLxBxzB_8xwHgAAAC
isn't exactly user friendly. I want people to be able to type the code if they choose to, so it needs to be as short as possible.
How is this kind of thing normally done? I'm using Node.js and client side JS.