From 4fc33c99ee5eb02d8a1718b52d0d300a769b26d4 Mon Sep 17 00:00:00 2001 From: Kenneth Bell Date: Fri, 20 Oct 2023 11:58:42 +0100 Subject: [PATCH] Document machine.HardwareID --- content/docs/reference/machine.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/docs/reference/machine.md b/content/docs/reference/machine.md index 91992ef3..e372052d 100644 --- a/content/docs/reference/machine.md +++ b/content/docs/reference/machine.md @@ -365,6 +365,14 @@ CPUReset performs a hard system reset. Not all chips support CPUReset. +```go +func HardwareID() []byte +``` + +HardwareID returns a byte array containing a unique id (aka Serial Number) specific to this chip. In some architectures (notably RP2040) the hardware ID is actually the ID of the flash chip. The hardware ID can be useful for identifying specific devices within a family. There is no guarantee the ID is globally unique. The size of the ID is chip-family specific with 8 bytes (64 bits) and 16 bytes (128 bits) being common. + +Not all chips have a hardware ID. + ```go func GetRNG() uint32 ```