{"id":13472580,"url":"https://github.com/rushmorem/publicsuffix","last_synced_at":"2025-04-04T12:10:07.248Z","repository":{"id":15099303,"uuid":"77560156","full_name":"rushmorem/publicsuffix","owner":"rushmorem","description":"An implementation of Mozilla's Public Suffix List in Rust","archived":false,"fork":false,"pushed_at":"2023-08-28T19:40:12.000Z","size":287,"stargazers_count":93,"open_issues_count":0,"forks_count":17,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-26T20:07:34.181Z","etag":null,"topics":["parsing","psl","publicsuffix","robust","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/rushmorem.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":"2016-12-28T20:42:51.000Z","updated_at":"2024-05-31T16:15:15.331Z","dependencies_parsed_at":"2024-05-31T16:15:14.015Z","dependency_job_id":"1df1ef46-2700-4975-8765-bef836e1fc4b","html_url":"https://github.com/rushmorem/publicsuffix","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushmorem%2Fpublicsuffix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushmorem%2Fpublicsuffix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushmorem%2Fpublicsuffix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushmorem%2Fpublicsuffix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rushmorem","download_url":"https://codeload.github.com/rushmorem/publicsuffix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174456,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["parsing","psl","publicsuffix","robust","rust-library"],"created_at":"2024-07-31T16:00:55.886Z","updated_at":"2025-04-04T12:10:07.198Z","avatar_url":"https://github.com/rushmorem.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# PublicSuffix\n\nA native Rust library for Mozilla's Public Suffix List\n\n[![CI](https://github.com/rushmorem/publicsuffix/actions/workflows/ci.yml/badge.svg)](https://github.com/rushmorem/publicsuffix/actions/workflows/ci.yml)\n[![Latest Version](https://img.shields.io/crates/v/publicsuffix.svg)](https://crates.io/crates/publicsuffix)\n[![Crates.io downloads](https://img.shields.io/crates/d/publicsuffix)](https://crates.io/crates/publicsuffix)\n[![Docs](https://docs.rs/publicsuffix/badge.svg)](https://docs.rs/publicsuffix)\n[![Minimum supported Rust version](https://img.shields.io/badge/rustc-1.56.1+-yellow.svg)](https://www.rust-lang.org)\n![Maintenance](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nThis library uses Mozilla's [Public Suffix List](https://publicsuffix.org) to reliably determine the suffix of a domain name. This crate provides a dynamic list that can be updated at runtime. If you need a faster, though static list, please use the [psl](https://crates.io/crates/psl) crate instead.\n\n*NB*: v1 of this crate contained logic to validate domain names and email addresses. Since v2, this functionality was moved to the [addr](https://crates.io/crates/addr) crate. This crate also no longer downloads the list for you.\n\n## Setting Up\n\nAdd this crate to your `Cargo.toml`:\n\n```toml\n[dependencies]\npublicsuffix = \"2\"\n```\n\n## Examples\n\n```rust\nuse publicsuffix::{Psl, List};\n\n// the official list can be found at\n// https://publicsuffix.org/list/public_suffix_list.dat\nlet list: List = \"\u003c-- your public suffix list here --\u003e\".parse()?;\n\nlet suffix = list.suffix(b\"www.example.com\")?;\nassert_eq!(suffix, \"com\");\nassert_eq!(suffix.typ(), Some(Type::Icann));\n\nlet domain = list.domain(b\"www.example.com\")?;\nassert_eq!(domain, \"example.com\");\nassert_eq!(domain.suffix(), \"com\");\n\nlet domain = list.domain(\"www.食狮.中国\".as_bytes())?;\nassert_eq!(domain, \"食狮.中国\");\nassert_eq!(domain.suffix(), \"中国\");\n\nlet domain = list.domain(b\"www.xn--85x722f.xn--55qx5d.cn\")?;\nassert_eq!(domain, \"xn--85x722f.xn--55qx5d.cn\");\nassert_eq!(domain.suffix(), \"xn--55qx5d.cn\");\n\nlet domain = list.domain(b\"a.b.example.uk.com\")?;\nassert_eq!(domain, \"example.uk.com\");\nassert_eq!(domain.suffix(), \"uk.com\");\n\nlet domain = list.domain(b\"_tcp.example.com.\")?;\nassert_eq!(domain, \"example.com.\");\nassert_eq!(domain.suffix(), \"com.\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frushmorem%2Fpublicsuffix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frushmorem%2Fpublicsuffix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frushmorem%2Fpublicsuffix/lists"}