Fix IsValidID/IsValidSig doc comments; remove ValidateID, GetIDBytes, checkIDMatch

This commit is contained in:
Jay
2026-05-22 11:35:30 -04:00
parent 0ca44c7e20
commit 17789a7dbd
3 changed files with 12 additions and 44 deletions
+1 -6
View File
@@ -9,15 +9,10 @@ import (
// GetID computes and returns the event ID as a lowercase, hex-encoded SHA-256 hash
// of the serialized event.
func GetID(e Event) string {
hash := GetIDBytes(e)
hash := sha256.Sum256(Serialize(e))
return hex.EncodeToString(hash[:])
}
// GetIDBytes computes and returns the event ID as a raw SHA256 digest
func GetIDBytes(e Event) [32]byte {
return sha256.Sum256(Serialize(e))
}
// Serialize returns the canonical JSON array representation of the event.
// used for ID computation: [0, pubkey, created_at, kind, tags, content].
func Serialize(e Event) []byte {