Description
Suggestion
as @tulir said at https://matrix.to/#/!jxlRxnrZCsjpjDubDX:matrix.org/$-xKHLlfL78MHJdaATNfVN4n6uKmwOCprtCeq8R6YC54
and https://matrix.to/#/!jxlRxnrZCsjpjDubDX:matrix.org/$mPPNr807kgN8DPy_SEM2ct3-8kb51JArhGqkbexM5lk :
event IDs are easy. As of room v3, they're just base64 hashes, so they're fixed length and fixed charset (room v3 = normal unpadded base64, room v4+ = url-safe unpadded base64)
user IDs, room IDs/aliases and v1/v2 event IDs are not that nice, they can all technically contain arbitrary unicode, but it depends on where/why you're validating it
This is a serious problem for server and client developers who want to implement an implementation for a memory constrained machine. Hence, room and user identifiers should be specified to be fixed length (though, for users, this is blocked by using the usernames as user identifiers(MXIDs)).