{"id":21857921,"url":"https://github.com/mathematic-inc/addr-spec-rs","last_synced_at":"2025-04-14T18:41:25.278Z","repository":{"id":65450397,"uuid":"592575127","full_name":"mathematic-inc/addr-spec-rs","owner":"mathematic-inc","description":"A wicked fast UTF-8 email address parser and serializer.","archived":false,"fork":false,"pushed_at":"2025-04-06T22:50:13.000Z","size":716,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T23:27:13.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathematic-inc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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},"funding":{"github":"mathematic-inc"}},"created_at":"2023-01-24T02:47:39.000Z","updated_at":"2025-04-06T22:49:57.000Z","dependencies_parsed_at":"2024-06-06T01:53:41.790Z","dependency_job_id":"503bbe40-093b-41f1-acba-7be1d329f202","html_url":"https://github.com/mathematic-inc/addr-spec-rs","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.2857142857142857,"last_synced_commit":"f339a1a9bb296323c4a681ff398123306b820ab9"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathematic-inc%2Faddr-spec-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathematic-inc%2Faddr-spec-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathematic-inc%2Faddr-spec-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathematic-inc%2Faddr-spec-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathematic-inc","download_url":"https://codeload.github.com/mathematic-inc/addr-spec-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248938201,"owners_count":21186361,"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":[],"created_at":"2024-11-28T02:33:26.270Z","updated_at":"2025-04-14T18:41:25.254Z","avatar_url":"https://github.com/mathematic-inc.png","language":"Rust","funding_links":["https://github.com/sponsors/mathematic-inc"],"categories":[],"sub_categories":[],"readme":"# addr-spec\n\n[![crates.io](https://img.shields.io/crates/v/addr-spec?style=flat-square)](https://crates.io/crates/addr-spec)\n[![license](https://img.shields.io/crates/l/addr-spec?style=flat-square)](https://github.com/mathematic-inc/addr-spec-rs)\n[![ci](https://img.shields.io/github/actions/workflow/status/mathematic-inc/addr-spec-rs/ci.yaml?label=ci\u0026style=flat-square)](https://github.com/mathematic-inc/addr-spec-rs/actions/workflows/ci.yaml)\n[![docs](https://img.shields.io/docsrs/addr_spec?style=flat-square)](https://docs.rs/addr_spec/latest/addr_spec/)\n\nA wicked fast UTF-8 email address parser and serializer. It provides\n\n- unopinionated, _correct_ parsing of email addresses (defined as `addr-spec` in\n  [RFC 5322](https://www.rfc-editor.org/rfc/rfc5322)),\n- extremely fast serialization and deserialization using low-level memory\n  management,\n- guarantees on the uniqueness of an email address,\n- UTF-8 support with NFC normalization as recommended in [RFC\n  6532](https://datatracker.ietf.org/doc/html/rfc6532), and\n- format validation based on the grammar set out in [Section 3.4.1, RFC\n  5322](https://www.rfc-editor.org/rfc/rfc5322#section-3.4.1) and [Section 3.2,\n  RFC 6532](https://datatracker.ietf.org/doc/html/rfc6532#section-3.2) with\n  position-accurate errors.\n\n## Features\n\nThis crate supports the following features:\n\n- `normalization` - This enables (NFC) normalization of addresses.\n- `comments` - This allows parsing (but not serialization; see\n  [Caveats](#comments)) of comments.\n- `literals` - This allows parsing and serialization of literal domains.\n- `white-spaces` - This allows parsing (but not serialization; see\n  [Caveats](#folding-white-spaces)) of whitepaces.\n\nBy default, `normalization` is enabled.\n\n## Caveats\n\n### Folding white spaces\n\nSerializing folding white spaces (abbr. FWS) is not supported since it is\ndependent on the transport mechanism. If you need to break the address along\nfoldable boundaries, you can use `into_serialized_parts` which returns\nserialized versions of the local part and domain.\n\n### Comments\n\nSerializing comments is not supported since it is dependent on the transport\nmechanism. At the moment, comments are parsed, but skipped as there is no\nuniform way of handling them. If you would like comments to be stored, please\nfile an issue with your use-case.\n\n## Alternatives\n\n### [email_address](https://docs.rs/email_address/latest/email_address/)\n\nThis crate provides a \"newtype\" `EmailAddress` which under the hood just\nvalidates and wraps an address string.\n\nIt does not support white spaces, comments, and UTF-8 normalization, nor does it\nsupport address normalization (e.g. `\"te st\"@example.com` is equivalent to\n`test@example.com`, but this cannot be distinguished with `email_address`).\n\n#### Benchmarks\n\nIn scenarios supported by `email_address` (no comments, no white-spaces, no\nUTF-8/address normalization), `email_address` slightly outperforms `addr_spec`\nby about 5% with all features off which makes sense since `email_address` cannot\ndistinguish equivalent addresses.\n\n#### Migration\n\nIt's highly recommended to use only `addr_spec` in production since `addr_spec`\nprovides guarantees on uniqueness for storage and lookup as well as other\nspecial perks (position-based errors, SMTP-style `Display` writer, etc.). If\nthis is not feasible, we provide `Into\u003cEmailAddress\u003e` and `Into\u003cAddrSpec\u003e` for\nthose coming from `email_address`. Note that `Into\u003cAddrSpec\u003e` is a only a [right\ninverse](https://en.wikipedia.org/wiki/Inverse_function#Left_and_right_inverses)\nof `Into\u003cEmailAddress\u003e`, i.e. `AddrSpec -\u003e EmailAddress -\u003e AddrSpec` will always\nyield the same `AddrSpec`, but `EmailAddress -\u003e AddrSpec -\u003e EmailAddress` may\nnot yield the same `EmailAddress`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathematic-inc%2Faddr-spec-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathematic-inc%2Faddr-spec-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathematic-inc%2Faddr-spec-rs/lists"}