Device ID From Public Key • AI Agent SDK

device_id_from_public_key: Return the stable device id: hex SHA-256 of the raw public-key bytes.

device_id_from_public_key

Function

</div>

This function is defined in the protocols module.

Return the stable device id: hex SHA-256 of the raw public-key bytes.

`public_key must be standard base64 (RFC 4648, padded, no whitespace) of the raw key bytes. Hashing the decoded bytes keeps the id independent of how a client spells the encoding. Raises ValueError` on invalid base64.

Signature

python
def device_id_from_public_key(public_key: str) -> str

Parameters

ParamField str

No description available.

Returns

ResponseField str

The result of the operation.

Uses

  • hexdigest
  • hashlib.sha256
  • base64.b64decode

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 362