{"id":37095777,"url":"https://github.com/zxdev/url","last_synced_at":"2026-01-14T11:48:09.265Z","repository":{"id":222071289,"uuid":"742234712","full_name":"zxdev/url","owner":"zxdev","description":"simple url parser and standardizer","archived":false,"fork":false,"pushed_at":"2024-01-12T03:00:38.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T20:09:24.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zxdev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-12T03:00:37.000Z","updated_at":"2024-01-12T03:00:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"50b701df-5310-48e5-ba81-883abae49653","html_url":"https://github.com/zxdev/url","commit_stats":null,"previous_names":["zxdev/url"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zxdev/url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdev%2Furl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdev%2Furl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdev%2Furl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdev%2Furl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zxdev","download_url":"https://codeload.github.com/zxdev/url/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdev%2Furl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T11:48:08.624Z","updated_at":"2026-01-14T11:48:09.256Z","avatar_url":"https://github.com/zxdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# url\n\nThe url package is a simple url standardizer that parses a url into constituant parts and will set url.IP or url.IDNA flag when detected. Parse generally confirms the hostname has the basic elements required for domain or an IPv4/6 address.\n\nConvenience helper functions are provided for simple boolean tests along with simple extractions or manipulations. A convenience Parser method reads off an io.Reader source and populates the passed in *url.URL and unique key generator for standardizing to 64-bit or 256-bit based a stated kind format requested.\n\nThe safebrowsing package contains the urls.go package extracted from ```google/safebrowsing``` for safebrowsing standardization and validation to help with malicious spoofing attemts. It does not include the hasher package.\n\n```golang\n\n    // convienence helper example\n    var u url.URL\n    u.Parse(\"example.com/path/logo.jpg\")\n    if url.HasPage(u) {\n        url.NoPage(u)\n    }\n\n    // convienence parser example\n\tr, _ := os.Open(\"my/file\")\n\tdefer r.Close()\n    var u url.URL\n\tnext := url.Parser(r)\n\tfor next(\u0026u) {\n\t\tfmt.Println(u.Host)\n\t}\n    \n    // unique key generator example\n    u.Parse(\"sub.example.com/path\")\n    FPHex64(u,url.Apex) // 2883ba7dc9aa3289\n    FPHex64(u,url.Host) // 41e8219220802dab\n    FPHex64(u,url.Full) // 3d173d4e8fd04260\n\n    // safebrowsing stanadardization example that converts\n    // alternative ipv4 format to ipv4 dot notation\n    url, _ := safebrowsing.ParseURL(\"991234565/path/page\")\n\tfmt.Println(url) // http://59.21.10.5/path/page\n\n\n```\n\nNote: It may be necessary to recompile or refresh the ```golang/x/net/publicsuffix``` package periodically to keep it current since it uses an intenally compressed reference set.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxdev%2Furl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzxdev%2Furl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxdev%2Furl/lists"}