🔍
CVE Format Validation
Complete CVE format validation and standardization to ensure correctness and consistency of CVE identifiers.
A powerful and easy-to-use library for handling CVE (Common Vulnerabilities and Exposures) identifiers
go get github.com/scagogogo/cve
package main
import (
"fmt"
"github.com/scagogogo/cve"
)
func main() {
// Format CVE
formatted := cve.Format("cve-2022-12345")
fmt.Println(formatted) // Output: CVE-2022-12345
// Validate CVE
isValid := cve.ValidateCve("CVE-2022-12345")
fmt.Println(isValid) // Output: true
// Extract CVE from text
text := "System affected by CVE-2021-44228 and CVE-2022-12345"
cves := cve.ExtractCve(text)
fmt.Println(cves) // Output: [CVE-2021-44228 CVE-2022-12345]
}