Function

ValentDevicevalidate_id

unstable since: 1.0

Declaration [src]

gboolean
valent_device_validate_id (
  const char* id
)

Description [src]

Validate a KDE Connect device ID.

A compliant device ID matches the pattern /^[a-zA-Z0-9]{32,38}$/, being alphanumeric with a length of 32-38 characters. However, for backwards compatibility, implementations must accept device IDs that include hyphens and underscores.

This became a requirement in version 8 of the KDE Connect protocol.

Available since: 1.0

Parameters

id

Type: const char*

A KDE Connect device ID.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: gboolean

TRUE if valid, or FALSE.