Skip to main content

Module util

Module util 

Source

Functionsยง

current_timestamp
Creates a timestamp string for the current time
format_duration
Formats a duration in a human-readable way
get_md5
Calculates MD5 hash of the input Note: MD5 is used here for compatibility with the protocol, not for security
is_encrypted_channel
Checks if a channel is encrypted (moved from channel.rs for backward compatibility)
join_strings
Efficiently joins strings with a separator
secure_compare
Constant-time string comparison to prevent timing attacks
to_ordered_array
Converts a map to an ordered array of key=value pairs
validate_channel
Validates a channel name (moved to channel.rs but kept for backward compatibility)
validate_presence_channel
Validates that a channel name starts with presence-.
validate_socket_id
Validates a socket ID
validate_user_id
Validates a user ID