Decision Workspace
contextual-encoder vs ammonia vs htmlsanitizer
Side-by-side comparison of Rust crates
44
contextual-encoder
experimentalv0.2.0
contextual output encoding for xss defense, inspired by the owasp java encoder
67
ammonia
growingv4.1.2
HTML Sanitization
41
htmlsanitizer
experimentalv0.2.0
A fast, allowlist-based HTML sanitizer
Core Metrics
| contextual-encoder | ammonia | htmlsanitizer | |
|---|---|---|---|
| Health Score | 44 | 67 | 41 |
| Total Downloads | 24 | 10.2M | 29 |
| 30d Downloads | 24 | 516.7K | 29 |
| Dependents | 0 | 1.3K | 0 |
| Releases | 2 | 39 | 3 |
| Last Updated | 6d ago | 187d ago | today |
| Age | 6d | 10y 6m | 1d |
Health Breakdown
contextual-encoder
Maintenance
14
Quality
15
Community
6
Popularity
2
Documentation
7
ammonia
Maintenance
11
Quality
13
Community
20
Popularity
8
Documentation
15
htmlsanitizer
Maintenance
14
Quality
9
Community
6
Popularity
2
Documentation
10
Technical Details
| contextual-encoder | ammonia | htmlsanitizer | |
|---|---|---|---|
| Version | 0.2.0 | 4.1.2 | 0.2.0 |
| Stable (≥1.0) | ✗ No | ✓ Yes | ✗ No |
| License | MIT | MIT OR Apache-2.0 | MIT |
| Dependencies | 0 | 7 | 4 |
| Crate Size | 33KB | 57KB | 62KB |
| Features | 0 | 0 | 2 |
| Yanked % | 0.0% | 66.7% | 66.7% |
| Edition | 2021 | 2021 | 2021 |
| MSRV | — | 1.80 | — |
| Owners | 1 | 2 (team) | 1 |
Links
Quick Verdict
- •ammonia leads with a health score of 67/100, but none of the options score above 80.
- •ammonia is depended on by 1.3K crates — strongest ecosystem trust.
- •contextual-encoder, htmlsanitizer are pre-1.0 — API may change.