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. Recommended practice is to generate a UUIDv4 and remove the hyphens (-), or replace them with underscores (_).

This became a requirement in version 8 or 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.