{"action":"created","issue":{"url":"https://api.github.com/repos/eprintsug/EPrintsArchivematica/issues/6","repository_url":"https://api.github.com/repos/eprintsug/EPrintsArchivematica","labels_url":"https://api.github.com/repos/eprintsug/EPrintsArchivematica/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/eprintsug/EPrintsArchivematica/issues/6/comments","events_url":"https://api.github.com/repos/eprintsug/EPrintsArchivematica/issues/6/events","html_url":"https://github.com/eprintsug/EPrintsArchivematica/issues/6","id":384143098,"node_id":"MDU6SXNzdWUzODQxNDMwOTg=","number":6,"title":"Use Sha instead of md5","user":{"login":"goetzk","id":8732490,"node_id":"MDQ6VXNlcjg3MzI0OTA=","avatar_url":"https://avatars0.githubusercontent.com/u/8732490?v=4","gravatar_id":"","url":"https://api.github.com/users/goetzk","html_url":"https://github.com/goetzk","followers_url":"https://api.github.com/users/goetzk/followers","following_url":"https://api.github.com/users/goetzk/following{/other_user}","gists_url":"https://api.github.com/users/goetzk/gists{/gist_id}","starred_url":"https://api.github.com/users/goetzk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goetzk/subscriptions","organizations_url":"https://api.github.com/users/goetzk/orgs","repos_url":"https://api.github.com/users/goetzk/repos","events_url":"https://api.github.com/users/goetzk/events{/privacy}","received_events_url":"https://api.github.com/users/goetzk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-26T01:29:02Z","updated_at":"2018-12-19T12:22:18Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nAs a related point to #5 ; I would like to propose the spec supports Sha256 instead of md5 as its default checksum.\r\n\r\nAs a future feature it should probably support md5, sha1 and sha256 (archivematica's three options) but I don't see it being a pressing issue from the start as sha256 and md5 are those supported by eprints OOTB.\r\n\r\nFrom eprints commit be42eb7f4dd9ebc184ff8f7fb0282d2f8e778f21\r\n``` perl\r\n=item $md5 = $stored->generate_md5\r\n\r\nCalculates and returns the MD5 for this file.\r\n\r\n=cut\r\n\r\nsub generate_md5\r\n{\r\n        my( $self ) = @_;\r\n\r\n        my $md5 = Digest::MD5->new;\r\n\r\n        $self->get_file(sub {\r\n                $md5->add( $_[0] )\r\n        });\r\n\r\n        return $md5->hexdigest;\r\n}\r\n\r\nsub update_md5\r\n{\r\n        my( $self ) = @_;\r\n\r\n        my $md5 = $self->generate_md5;\r\n\r\n        $self->set_value( \"hash\", $md5 );\r\n        $self->set_value( \"hash_type\", \"MD5\" );\r\n}\r\n\r\n=item $digest = $file->generate_sha( [ ALGORITHM ] )\r\n\r\nGenerate a SHA for this file, see L<Digest::SHA> for a list of supported algorithms. Defaults to \"256\" (SHA-256).\r\n\r\nReturns the hex-encoded digest.\r\n\r\n=cut\r\n\r\nsub generate_sha\r\n{\r\n        my( $self, $alg ) = @_;\r\n\r\n        $alg ||= \"256\";\r\n\r\n        my $sha = Digest::SHA->new( $alg );\r\n\r\n        $self->get_file(sub {\r\n                $sha->add( $_[0] )\r\n        });\r\n\r\n        return $sha->hexdigest;\r\n}\r\n\r\nsub update_sha\r\n{\r\n        my( $self, $alg ) = @_;\r\n\r\n        $alg ||= \"256\";\r\n\r\n        my $digest = $self->generate_sha( $alg );\r\n\r\n        $self->set_value( \"hash\", $digest );\r\n        $self->set_value( \"hash_type\", \"SHA-$alg\" );\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/eprintsug/EPrintsArchivematica/issues/comments/448576263","html_url":"https://github.com/eprintsug/EPrintsArchivematica/issues/6#issuecomment-448576263","issue_url":"https://api.github.com/repos/eprintsug/EPrintsArchivematica/issues/6","id":448576263,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODU3NjI2Mw==","user":{"login":"geo-mac","id":15779066,"node_id":"MDQ6VXNlcjE1Nzc5MDY2","avatar_url":"https://avatars3.githubusercontent.com/u/15779066?v=4","gravatar_id":"","url":"https://api.github.com/users/geo-mac","html_url":"https://github.com/geo-mac","followers_url":"https://api.github.com/users/geo-mac/followers","following_url":"https://api.github.com/users/geo-mac/following{/other_user}","gists_url":"https://api.github.com/users/geo-mac/gists{/gist_id}","starred_url":"https://api.github.com/users/geo-mac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geo-mac/subscriptions","organizations_url":"https://api.github.com/users/geo-mac/orgs","repos_url":"https://api.github.com/users/geo-mac/repos","events_url":"https://api.github.com/users/geo-mac/events{/privacy}","received_events_url":"https://api.github.com/users/geo-mac/received_events","type":"User","site_admin":false},"created_at":"2018-12-19T12:22:18Z","updated_at":"2018-12-19T12:22:18Z","author_association":"NONE","body":"...that should read, \"although sha256 is support by EPrints -- MD5 is specified....\" - Sorry for the confusion!"}}
{"actor":{"display_login":"geo-mac"}}