debian-mirror-gitlab/app/models/concerns/checksummable.rb
2020-11-24 15:15:51 +05:30

15 lines
236 B
Ruby

# frozen_string_literal: true
module Checksummable
extend ActiveSupport::Concern
def crc32(data)
Zlib.crc32(data)
end
class_methods do
def hexdigest(path)
::Digest::SHA256.file(path).hexdigest
end
end
end