Welcome to mirror list, hosted at ThFree Co, Russian Federation.

checksummable.rb « concerns « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d6d17bfc604d57bc15a50540820d841cabcef0ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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