module Roda::RodaPlugins::RouteCsrf::InstanceMethods

def csrf_hmac(random_data, method, path)

Return the HMAC-SHA-256 for the secret and the given arguments.
def csrf_hmac(random_data, method, path)
  OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, csrf_secret, "#{method.to_s.upcase}#{path}#{random_data}")
end