feat: 16 funciones cybersecurity — análisis, crypto e IO de seguridad
12 funciones puras con implementación real: HashSHA256, HashMD5, EntropyShannon, IsBase64, IsHex, ExtractURLs, ParseIPCIDR, IPInRange, NormalizeURL, DetectSQLInjection, LevenshteinDistance, JaccardSimilarity 4 funciones impuras con implementación real (stdlib): LookupWhois, ResolveDNS, FetchHTTPHeaders, ScanPortTCP Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package cybersecurity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
)
|
||||
|
||||
// ResolveDNS resuelve un hostname a sus direcciones IP usando el resolver del sistema.
|
||||
func ResolveDNS(host string) ([]string, error) {
|
||||
ips, err := net.LookupHost(host)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error resolviendo DNS para %s: %w", host, err)
|
||||
}
|
||||
return ips, nil
|
||||
}
|
||||
Reference in New Issue
Block a user