Encode and decode public room tokens