Compute a normalized hash matching the plugin's dedup logic: lowercase → trim whitespace → hash as hex string. Uses std::hash for portability (no SHA crate in deps); the exact hash algorithm doesn't matter as long as it's consistent within the dashboard. The plugin uses its own Bun-based hash path. Match the plugin's `computeNormalizedHash`: lowercase → collapse whitespace → trim → MD5 hex.
(content: &str)
| 785 | /// the dashboard. The plugin uses its own Bun-based hash path. |
| 786 | /// Match the plugin's `computeNormalizedHash`: lowercase → collapse whitespace → trim → MD5 hex. |
| 787 | fn normalize_hash(content: &str) -> String { |
| 788 | let normalized = content.to_lowercase(); |
| 789 | // Collapse all whitespace runs into a single space (mirrors JS /\s+/g → " ") |
| 790 | let normalized: String = normalized.split_whitespace().collect::<Vec<_>>().join(" "); |
| 791 | let digest = md5::compute(normalized.as_bytes()); |
| 792 | format!("{:032x}", digest) |
| 793 | } |
| 794 | |
| 795 | fn format_timestamp_iso(timestamp: i64) -> String { |
| 796 | chrono::DateTime::<chrono::Utc>::from_timestamp_millis(timestamp) |
no outgoing calls
no test coverage detected