Skip to main content

validate_call_key

Function validate_call_key 

Source
pub fn validate_call_key(key: &str) -> Result<(), CallKeyError>
Expand description

Check a call_key: 1 to CALL_KEY_MAX_LEN characters, each printable ASCII from 0x21 to 0x7E.

Space (0x20) is refused. Providers compare keys byte for byte and write them into logs and ledgers, where a leading or trailing space is invisible: two keys that differ only by one would read as the same key and act as different ones. Every other printable character is allowed, so a consumer can use its existing ids (UUIDs, prefix:id forms, base64) unchanged.