Sha256: 0828687a87c7bc9bf01510c7d669948c2b14ec46d7b8a0383d13a91be2f65941

Contents?: true

Size: 660 Bytes

Versions: 5

Compression:

Stored size: 660 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(Authable::SHA256_DIGEST, YETTO_PLUG_APP_TOKEN, body)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hephaestus-0.1.3 templates/script/hmac_text
hephaestus-0.1.2 templates/script/hmac_text
hephaestus-0.1.1 templates/script/hmac_text
hephaestus-0.0.2 templates/script/hmac_text
hephaestus-0.0.1 templates/script/hmac_text