diff --git a/atom.go b/atom.go index 8e1b443..b5e6671 100644 --- a/atom.go +++ b/atom.go @@ -1,10 +1,12 @@ package atom import ( + "fmt" "mime" "regexp" "strings" + "github.com/google/uuid" "golang.org/x/text/language" ) @@ -79,3 +81,8 @@ func isValidLanguageTag(tag LanguageTag) bool { _, err := language.Parse(string(tag)) return err == nil } + +// NewURN generates an new valid IRI based on a UUID. It returns an IRI. +func NewURN() IRI { + return IRI(fmt.Sprint("urn:uuid:", uuid.New())) +}