c3b2eb2b4f
* Generate a UUIDv5 from a random namespace based on WWN, model name, and serial number * Migrate sqlite and influxdb data accordingly * Update frontend API routes and components * Fixes #923
17 lines
546 B
Go
17 lines
546 B
Go
package detect
|
|
|
|
import (
|
|
"github.com/gofrs/uuid/v5"
|
|
)
|
|
|
|
// Randomly generated UUID v4 namespace for Scrutiny
|
|
var ScrutinyNamespaceUUID = uuid.Must(uuid.FromString("3ea22b35-682b-49fb-a655-abffed108e48"))
|
|
|
|
// WWN's are not actually unique so we use Model Name and Serial Number
|
|
// to hopefully create something that is actually unique despite
|
|
// manufacturer laziness
|
|
func GenerateScrutinyUUID(modelName string, serialNumber string, wwn string) uuid.UUID {
|
|
name := modelName + serialNumber + wwn
|
|
return uuid.NewV5(ScrutinyNamespaceUUID, name)
|
|
}
|