module Shrine::Plugins::Signature::ClassMethods

  1. lib/shrine/plugins/signature.rb

Methods

Public Instance

  1. calculate_signature

Public Instance methods

calculate_signature (io, algorithm, format: :hex)

Calculates algorithm hash of the contents of the IO object, and encodes it into format.

[show source]
# File lib/shrine/plugins/signature.rb, line 44
def calculate_signature(io, algorithm, format: :hex)
  algorithm = algorithm.downcase # support uppercase algorithm names like :MD5
  SignatureCalculator.new(algorithm, format: format).call(io)
end