diff options
Diffstat (limited to 'app/models/concerns/checksummable.rb')
-rw-r--r-- | app/models/concerns/checksummable.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/concerns/checksummable.rb b/app/models/concerns/checksummable.rb new file mode 100644 index 00000000000..1f76eb87aa5 --- /dev/null +++ b/app/models/concerns/checksummable.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Checksummable + extend ActiveSupport::Concern + + class_methods do + def hexdigest(path) + Digest::SHA256.file(path).hexdigest + end + end +end |