Sha256: 7ff0cba35cdd7dac155eec025941633d24eff0bdc8ca89747ec9f0ee0c2459f1

Contents?: true

Size: 676 Bytes

Versions: 22

Compression:

Stored size: 676 Bytes

Contents

#!/usr/bin/env rails runner
# frozen_string_literal: true

require "optparse"
require "debug" if ENV.fetch("DEBUG", false)

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: hmac_text [options]"

  opts.on("-l", "--load PATH", "Load file from path") { |v| options[:load_path] = v }
  opts.on("-p", "--parse STRING", "Parses string directly") { |v| options[:parse_string] = v }
end.parse!

body = if options[:load_path].present?
  File.read(options[:load_path])
elsif options[:parse_string].present?
  options[:parse_string]
end

puts "Parsing `#{body}` into HMAC"
puts OpenSSL::HMAC.hexdigest(Hephaestus::ValidatesFromYetto::SHA256_DIGEST, SIGNING_SECRET, body)

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
hephaestus-0.7.7.2 templates/script/hmac_text
hephaestus-0.7.7 templates/script/hmac_text
hephaestus-0.7.6.2 templates/script/hmac_text
hephaestus-0.7.6.1 templates/script/hmac_text
hephaestus-0.7.6 templates/script/hmac_text
hephaestus-0.7.5.3 templates/script/hmac_text
hephaestus-0.7.5.2 templates/script/hmac_text
hephaestus-0.7.5.1 templates/script/hmac_text
hephaestus-0.7.5 templates/script/hmac_text
hephaestus-0.7.4.2 templates/script/hmac_text
hephaestus-0.7.4.1 templates/script/hmac_text
hephaestus-0.7.4 templates/script/hmac_text
hephaestus-0.7.3.1 templates/script/hmac_text
hephaestus-0.7.3 templates/script/hmac_text
hephaestus-0.7.2.5 templates/script/hmac_text
hephaestus-0.7.2.4 templates/script/hmac_text
hephaestus-0.7.2.3 templates/script/hmac_text
hephaestus-0.7.2.2 templates/script/hmac_text
hephaestus-0.7.2.1 templates/script/hmac_text
hephaestus-0.7.2 templates/script/hmac_text