Skip to content

Add Isbn13 (identifiers) #17

Description

@vhrcgcom

Description

Implement Isbn13 as a ValueObject in the identifiers module.

Spec: ISBN-13 with check digit

Implementation checklist

  • Create src/identifiers/isbn13.rs
  • Implement ValueObject trait
  • Add #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
  • Export from src/identifiers/mod.rs and prelude
  • Unit tests: valid input · empty input · invalid format · normalisation
  • Doc comment with # Example block
  • Update status in ROADMAP.md from ⬜ to ✅

Implementation detail

Input / Output

Type Alias
Input String Isbn13Input
Output String Isbn13Output

Normalization

Strip hyphens and spaces; keep only digits. Output is 13 bare digits.

Validation

  • Exactly 13 digits after stripping.
  • Must start with 978 or 979.
  • Check digit validated using the EAN-13 algorithm (alternating weights 1 and 3, total mod 10 == 0).

Extra methods

  • prefix() -> &str — returns "978" or "979" (first 3 digits).

References

Activity

  1. changed the title [-]feat(identifiers): Isbn13[/-] [+]Add Isbn13 (identifiers)[/+] on Apr 17, 2026
  2. linked a pull request that will close this issueAdd identifiers module (v0.4.0) #85on Apr 20, 2026
  3. added a commit that references this issue on Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions