Sha256: 57c0453de02583625cea40346385d49bac4d55e373f16c3512274be928fede28

Contents?: true

Size: 1.93 KB

Versions: 13

Compression:

Stored size: 1.93 KB

Contents

# frozen_string_literal: true
#
# Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# Ronin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ronin is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ronin.  If not, see <https://www.gnu.org/licenses/>.
#

require 'ronin/cli/string_processor_command'

require 'digest'

module Ronin
  class CLI
    module Commands
      #
      # Calculates SHA512 hashes of data.
      #
      # ## Usage
      #
      #     ronin sha512 [options] [FILE ...]
      #
      # ## Options
      #
      #     -f, --file FILE                  Optional file to process
      #         --string STRING              Optional string to process
      #     -M, --multiline                  Process each line separately
      #     -n, --keep-newlines              Preserves newlines at the end of each line
      #     -h, --help                       Print help information
      #
      # ## Arguments
      #
      #     [FILE ...]                       Optional file(s) to process
      #
      class Sha512 < StringProcessorCommand

        description "Calculates SHA512 hashes"

        man_page 'ronin-sha512.1'

        #
        # Computes a SHA512 checksum for the given String.
        #
        # @param [String] string
        #   The input string.
        #
        # @return [String]
        #   The SHA512 hexdigest of the given String.
        #
        def process_string(string)
          Digest::SHA512.hexdigest(string)
        end

      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ronin-2.1.0 lib/ronin/cli/commands/sha512.rb
ronin-2.1.0.rc1 lib/ronin/cli/commands/sha512.rb
ronin-2.0.5 lib/ronin/cli/commands/sha512.rb
ronin-2.0.4 lib/ronin/cli/commands/sha512.rb
ronin-2.0.3 lib/ronin/cli/commands/sha512.rb
ronin-2.0.2 lib/ronin/cli/commands/sha512.rb
ronin-2.0.1 lib/ronin/cli/commands/sha512.rb
ronin-2.0.0 lib/ronin/cli/commands/sha512.rb
ronin-2.0.0.beta5 lib/ronin/cli/commands/sha512.rb
ronin-2.0.0.beta4 lib/ronin/cli/commands/sha512.rb
ronin-2.0.0.beta3 lib/ronin/cli/commands/sha512.rb
ronin-2.0.0.beta2 lib/ronin/cli/commands/sha512.rb
ronin-2.0.0.beta1 lib/ronin/cli/commands/sha512.rb