NewDeviceID generates a new device ID from SHA256 hash of the given piece of data (usually raw certificate bytes).
(rawCert []byte)
| 44 | // NewDeviceID generates a new device ID from SHA256 hash of the given piece |
| 45 | // of data (usually raw certificate bytes). |
| 46 | func NewDeviceID(rawCert []byte) DeviceID { |
| 47 | return DeviceID(sha256.Sum256(rawCert)) |
| 48 | } |
| 49 | |
| 50 | // DeviceIDFromString parses a device ID from a string. The string is expected |
| 51 | // to be in the canonical format, with check digits. |