refactor: use typedef to calculate digest size
refactor(demo): put dedup logic in bundle_uploader

Be prepared for a possible threaded uploading.