let digest_deps r dyndeps =
let buf = Buffer.create 1024 in
let add_resource r = Buffer.add_string buf (Digest.to_hex (Resource.digest r)) in
Buffer.add_string buf "deps:";
List.iter add_resource r.deps;
Buffer.add_string buf "dyndeps:";
Resources.iter add_resource dyndeps;
Digest.to_hex (Digest.string (Buffer.contents buf))