Closed FabianAronsson closed 1 year ago
Why does it have to be int? HashIds should not be stored in db
@Mojtabarezaei4 the hashids are not stored in the database. The package https://hashids.org/net/ does not support encoding strings or Guids, which means our room ids has to be ints.
When you encode something using the hashid package you use a salt which is a string and a number as input. The output is a string and we send this in the handler back to the client for use. When a user wants to connect from the client they send a room id in the form of our hashid which we decode to a int and compare it with our database and grant access to the user if it is a valid id.
Our room id's internally would simply be a self incrementing integer. There is no other solution if we decide to use the hashid package.
Yes I will change it
Adds support for hashids. We have to change our datamodel ids to ints, otherwise this package will not work.
Closes #29