Skip to content
/ swhid-rs Public

Reference implementation of the Software Hash Identifier (SWHID) standard - ISO 18670

License

Notifications You must be signed in to change notification settings

swhid/swhid-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

116 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swhid-rs: SWHID v1.2 reference implementation

This crate provides a minimal implementation of the SWHID (SoftWare Hash IDentifier) format as defined in ISO/IEC 18670:2025 and detailed in the SWHID v1.2 specification.

This implementation is fully compliant with SWHID v1.2 and provides:

  • Core identifier representation and parsing/printing (swh:1:<tag>:<id>)
  • All SWHID v1.2 object types: contents (cnt), directories (dir), revisions (rev), releases (rel), snapshots (snp)
  • Qualified identifiers (origin, visit, anchor, path, lines, bytes)
  • SWHID v1.2 compliant hash computation for content and directory objects
  • Optional VCS integration: computing rev, rel, snp SWHIDs from Git (requires git feature)

Installing the CLI

  • Rust: cargo install swhid (add --features git for VCS commands).
  • Binaries: Releases or Actions. Download for your OS/arch, extract, run (e.g. ./swhid --help).
  • More: User guide for all install options, library usage, examples, and CLI reference.

Quick start

Library: Content::from_bytes(b"data").swhid() -> swh:1:cnt:<hex>. Parse with "swh:1:cnt:...".parse::<Swhid>().

CLI: swhid content --file README.md · swhid dir . · swhid parse "swh:1:cnt:..." · swhid verify PATH SWHID

See the user guide for full documentation.

License

Licensed under MIT.

References

About

Reference implementation of the Software Hash Identifier (SWHID) standard - ISO 18670

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages