{"id":512,"date":"2019-03-29T10:10:46","date_gmt":"2019-03-29T14:10:46","guid":{"rendered":"https:\/\/library.brown.edu\/DigitalTechnologies\/?p=512"},"modified":"2019-03-29T10:10:46","modified_gmt":"2019-03-29T14:10:46","slug":"checksums","status":"publish","type":"post","link":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/checksums\/","title":{"rendered":"Checksums"},"content":{"rendered":"<p>In the BDR, we calculate checksums automatically on ingest (Fedora 3 provides that functionality for us), so all new content binaries going into the BDR get a checksum, which we can go back and check later as needed.<\/p>\n<p>We can also pass checksums into the BDR API, and then we verify that Fedora calculates the same checksum for the ingested file, which shows that the content wasn&#8217;t modified since the first checksum was calculated. We have only been able to use MD5 checksums, but we want to be able to use more checksum types. This isn&#8217;t a problem for Fedora, which can calculate multiple checksum types, such as <a href=\"https:\/\/wiki.duraspace.org\/display\/FEDORA38\/REST+API#RESTAPI-modifyDatastream\">MD5, SHA1, SHA256, and SHA512<\/a>.<\/p>\n<p>However, there is a complicating factor &#8211; if Fedora gets a checksum mismatch, by default it returns a 500 response code with no message, so we can&#8217;t tell whether it was a checksum mismatch or some other server error. Thanks to Ben Armintor, though, we found that we can update our Fedora configuration so <a href=\"https:\/\/groups.google.com\/d\/msg\/fedora-tech\/PAv1LYWPW0k\/9yo7ekmXJIIJ\">it returns the Checksum Mismatch information<\/a>.<\/p>\n<p>Another issue in this process is that we use <a href=\"https:\/\/github.com\/emory-libraries\/eulfedora\/\">eulfedora<\/a> (which <a href=\"https:\/\/github.com\/emory-libraries\/eulfedora\/issues\/29\">doesn&#8217;t seem to be maintained anymore<\/a>). If a checksum mismatch happens, it raises a DigitalObjectSaveFailure, but we want to know that there was a checksum mismatch. We <a href=\"https:\/\/github.com\/Brown-University-Library\/eulfedora\/\">forked eulfedora<\/a> and exposed the <a href=\"https:\/\/github.com\/Brown-University-Library\/eulfedora\/commit\/7935840c09d0f8351308c7a4294ad8221b1e7c7b\">checksum mismatch information<\/a>. Now we can remove some extra code that we had in our APIs, since more functionality is handled in Fedora\/eulfedora, and we can use multiple checksum types.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the BDR, we calculate checksums automatically on ingest (Fedora 3 provides that functionality for us), so all new content binaries going into the BDR get a checksum, which we can go back and check later as needed. We can also pass checksums into the BDR API, and then we verify that Fedora calculates the &hellip; <a href=\"https:\/\/library.brown.edu\/create\/digitaltechnologies\/checksums\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Checksums<\/span><\/a><\/p>\n","protected":false},"author":110,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-512","post","type-post","status-publish","format-standard","hentry","category-bdr"],"_links":{"self":[{"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/posts\/512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/comments?post=512"}],"version-history":[{"count":0,"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/posts\/512\/revisions"}],"wp:attachment":[{"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/media?parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/categories?post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/library.brown.edu\/create\/digitaltechnologies\/wp-json\/wp\/v2\/tags?post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}