15 lines
346 B
Go
15 lines
346 B
Go
// Package memoryidentity keeps Viking uploads and native recall in one namespace.
|
|||
|
|
package memoryidentity
|
||
|
|
|
||
|
|
import (
|
||
|
|
"crypto/sha256"
|
||
|
|
"encoding/hex"
|
||
|
|
)
|
||
|
|
|
||
|
|
const AssistantID = "platform_companion_v1"
|
||
|
|
|
||
|
|
func UserID(tenant, subject string) string {
|
||
|
|
digest := sha256.Sum256([]byte(tenant + ":" + subject))
|
||
|
|
return "u_" + hex.EncodeToString(digest[:])
|
||
|
|
}
|