Skip to main content

device_id_from_public_key

Function
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

Parameters

str
required
No description available.

Returns

str
The result of the operation.

Uses

  • hexdigest
  • hashlib.sha256
  • base64.b64decode

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 362