Add digests to unit type
Add simple tests