actionhash 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e572be34c1fe6fb616b9337a9cbeb30f8aae54b5ed838429fb1deb3e0e182184
4
+ data.tar.gz: f85bb350444e5bac864404934980d0dcbc29befc5c4089c3a8eab6b98b78f878
5
+ SHA512:
6
+ metadata.gz: 6c23cbe7e6aeefe57d7e1fcc277ff2a22eb0d45d067dac399c54c7ca566a564bfc86f29dfe0e2f03e2ba31162a7d84251898a8a6d5f866c536c45c6c6a142368
7
+ data.tar.gz: 7943e8f3d80b98ac96d9b4e162063ac74eeab2ac969e448852f6fc77a26f5f611108e15cf7569f460e85baa6b1d73baef30a1aaea58fb11473c644373ca5c9c1
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ceo@pixelatedstudios.net. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in actionhash.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
9
+
10
+ gem 'rspec', '~> 3.0'
11
+
12
+ gem 'rubocop', '~> 1.21'
data/Gemfile.lock ADDED
@@ -0,0 +1,65 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ actionhash (1.0.0)
5
+ dotenv (~> 2.7)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ base64 (0.1.1)
12
+ diff-lcs (1.5.0)
13
+ dotenv (2.8.1)
14
+ json (2.6.3)
15
+ language_server-protocol (3.17.0.3)
16
+ parallel (1.23.0)
17
+ parser (3.2.2.3)
18
+ ast (~> 2.4.1)
19
+ racc
20
+ racc (1.7.1)
21
+ rainbow (3.1.1)
22
+ rake (13.0.6)
23
+ regexp_parser (2.8.1)
24
+ rexml (3.2.6)
25
+ rspec (3.12.0)
26
+ rspec-core (~> 3.12.0)
27
+ rspec-expectations (~> 3.12.0)
28
+ rspec-mocks (~> 3.12.0)
29
+ rspec-core (3.12.2)
30
+ rspec-support (~> 3.12.0)
31
+ rspec-expectations (3.12.3)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.12.0)
34
+ rspec-mocks (3.12.6)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.12.0)
37
+ rspec-support (3.12.1)
38
+ rubocop (1.56.3)
39
+ base64 (~> 0.1.1)
40
+ json (~> 2.3)
41
+ language_server-protocol (>= 3.17.0)
42
+ parallel (~> 1.10)
43
+ parser (>= 3.2.2.3)
44
+ rainbow (>= 2.2.2, < 4.0)
45
+ regexp_parser (>= 1.8, < 3.0)
46
+ rexml (>= 3.2.5, < 4.0)
47
+ rubocop-ast (>= 1.28.1, < 2.0)
48
+ ruby-progressbar (~> 1.7)
49
+ unicode-display_width (>= 2.4.0, < 3.0)
50
+ rubocop-ast (1.29.0)
51
+ parser (>= 3.2.1.0)
52
+ ruby-progressbar (1.13.0)
53
+ unicode-display_width (2.4.2)
54
+
55
+ PLATFORMS
56
+ x86_64-linux
57
+
58
+ DEPENDENCIES
59
+ actionhash!
60
+ rake (~> 13.0)
61
+ rspec (~> 3.0)
62
+ rubocop (~> 1.21)
63
+
64
+ BUNDLED WITH
65
+ 2.4.10
data/LICENSE ADDED
@@ -0,0 +1,71 @@
1
+ PixelRidge Business Exclusive General Public Use License for Software Executables (PixelRidge-BEGPULSE)
2
+
3
+ ## Version 1.3
4
+
5
+ ### Preamble
6
+
7
+ This License governs the terms under which the software ("Software") provided by PixelRidge Softworks ("Licensor") may be used, modified, and distributed.
8
+
9
+ ### 1. Definitions
10
+
11
+ - **Software**: The original software and associated documentation provided under this license.
12
+ - **Business Purposes**: Any activity designed with the main intent to generate revenue or profit.
13
+ - **Modification**: Any change or addition to the Software's source code or executable.
14
+ - **Distribution**: The act of making the Software available to third parties.
15
+ - **Contributor**: Any individual or entity that modifies or distributes the Software.
16
+
17
+ ### 2. License Grant
18
+
19
+ Subject to the terms and conditions of this License, Licensor hereby grants you a worldwide, non-exclusive, non-transferable, non-sublicensable license to use and modify the Software.
20
+
21
+ ### 3. Attribution
22
+
23
+ You must provide attribution to the Licensor by including a plain-view URI (or link) to the Licensor's website. This link must be easily visible to all users and not hidden under any circumstances. It should be noted that this should only apply in the event that it can. In the event a public link is impossible due to the nature of the usage of the Software, it's expected that attribution be given in a way such that the attribution complies with the Open Source Initiative standards for Open Source Attribution.
24
+
25
+ ### 4. Business Use
26
+
27
+ If you wish to use the Software for Business Purposes, you must obtain written permission from PixelRidge Softworks. Failure to obtain such permission will result in a violation of this License.
28
+
29
+ ### 5. Indemnification
30
+
31
+ You agree to indemnify, defend, and hold harmless PixelRidge Softworks and its affiliates from and against any and all claims, damages, losses, liabilities, costs, and expenses arising out of or relating to your use or distribution of the Software.
32
+
33
+ ### 6. No Warranty and Limitation of Liability
34
+
35
+ The Software is provided "AS-IS," without any warranty of any kind, either express or implied. The Software is designed to be highly secure but will only be as secure as the system on which it is deployed. On an insecure system, the Software may exacerbate existing security issues. PixelRidge Softworks shall not be liable for any damages arising from the use of the Software.
36
+
37
+ ### 7. Updates and Versioning
38
+
39
+ PixelRidge Softworks may or may not provide updates to the Software in the future. There is no obligation to provide updates or support for the Software. The latest version of this License shall always be considered the governing terms. PixelRidge Softworks will provide reasonable notice in the event of a license change. Notice shall be provided via email. Due to spam laws, we cannot just email you. You may opt into our specialized mailing list for licensing on our website.
40
+
41
+ ### 8. Source Code Availability
42
+
43
+ Any modifications to the Software must remain open-source and source-available in their entirety unless another agreement with the Licensor is formed.
44
+
45
+ ### 9. Compliance Monitoring
46
+
47
+ Compliance with this License may or may not be monitored by PixelRidge Softworks. You grant PixelRidge Softworks the right to monitor for compliance as it sees fit.
48
+
49
+ ### 10. Data Collection
50
+
51
+ If the Software collects any data, such data will be used in accordance with PixelRidge Softworks' privacy policy.
52
+
53
+ ### 11. Export Control
54
+
55
+ You agree not to use the Software in violation of any export laws or regulations.
56
+
57
+ ### 12. Termination and Revocation
58
+
59
+ This License will automatically terminate if you fail to comply with any of its terms or conditions. Revocation is allowed only in the event of a violation of this License.
60
+
61
+ ### 13. Dispute Resolution
62
+
63
+ Any disputes arising out of this License shall be resolved through arbitration in Alberta, Canada.
64
+
65
+ ### 14. Jurisdiction
66
+
67
+ This License shall be governed by the laws of Alberta, Canada.
68
+
69
+ ### 15. Miscellaneous
70
+
71
+ This License constitutes the entire agreement between you and PixelRidge Softworks concerning the Software.
data/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # ActionHash
2
+
3
+ ## Overview
4
+
5
+ ActionHash is a Ruby gem designed to validate a series of actions while obfuscating the associated data. It's particularly useful in scenarios where you want to ensure the integrity of a sequence of actions or data points, such as in gaming, financial transactions, IoT devices, and more.
6
+
7
+ > :warning: **Security Note**: While ActionHash does obfuscate data, it should not be considered a form of encryption. If someone gains access to the generated secret key, the hashes can be undone. Use this gem as a part of your security strategy, not as the sole mechanism for securing sensitive information.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ gem install actionhash
13
+ ```
14
+
15
+ Or add it to your Gemfile:
16
+
17
+ ```ruby
18
+ gem 'actionhash'
19
+ ```
20
+
21
+ Then run:
22
+
23
+ ```bash
24
+ bundle install
25
+ ```
26
+
27
+ ## Basic Usage
28
+
29
+ Here's a simple example to get you started:
30
+
31
+ ```ruby
32
+ require 'actionhash'
33
+
34
+ # Initialize
35
+ keys = [ActionHash.generate_new_key]
36
+ hashes = [] # Array to store finished hashes
37
+ action_count = 0
38
+ prev_hash = '0'
39
+ data = "some_data"
40
+
41
+ # Create a hash
42
+ new_hash = ActionHash.create(prev_hash, data, keys.last)
43
+ hashes << new_hash # Store the hash
44
+ ```
45
+
46
+ ### Validating a Hash
47
+
48
+ You can validate a hash using the `valid_hash?` method as follows:
49
+
50
+ ```ruby
51
+ # Validate the hash
52
+ is_valid = ActionHash.valid_hash?(hashes.last, keys.last, 20)
53
+
54
+ if is_valid
55
+ puts "Hash is valid."
56
+ else
57
+ puts "Hash is invalid."
58
+ end
59
+ ```
60
+
61
+ The `valid_hash?` method works by recursively decrypting the hash and checking if it reaches a base hash of '0'. It takes the hash, the key, and an optional level parameter to limit the depth of validation.
62
+
63
+ Here's the method definition for your reference:
64
+
65
+ ```ruby
66
+ def self.valid_hash?(hash, key, level = 20)
67
+ current_level = 0
68
+ loop do
69
+ puts "Debug: Validating hash=#{hash} with key=#{key} at level=#{current_level}"
70
+ return false if current_level >= level
71
+
72
+ decrypted_data = down_layer(hash, key)
73
+ return true if decrypted_data[:prev_hash] == '0'
74
+ return false if decrypted_data[:prev_hash].nil? || decrypted_data[:prev_hash].empty?
75
+
76
+ hash = decrypted_data[:prev_hash]
77
+ current_level += 1
78
+ end
79
+ end
80
+ ```
81
+
82
+ ## Development Builds
83
+
84
+ For those interested in using development builds of ActionHash, you can install them directly from our Gem server hosted at PixelRidge Softworks.
85
+
86
+ Here's how you can install a development build:
87
+
88
+ ```bash
89
+ gem install ActionHash --source "https://git.pixelridgesoftworks.com/api/packages/PixelRidge-Softworks/rubygems"
90
+ ```
91
+
92
+ As an example, if you want to install a different gem from our Gem server, you can use the following command:
93
+
94
+ ```bash
95
+ gem install Miniparser --source "https://git.pixelridgesoftworks.com/api/packages/PixelRidge-Softworks/rubygems"
96
+ ```
97
+
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/actionhash/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'actionhash'
7
+ spec.version = Actionhash::VERSION
8
+ spec.authors = ['PixelRidge Softworks']
9
+ spec.email = ['ceo@pixelridgesoftworks.com']
10
+
11
+ spec.summary = 'A custom hash mechanism for action tracking and validation.'
12
+ spec.description = 'ActionHash is a Ruby gem designed to validate a series of actions while obfuscating the associated
13
+ data. Its particularly useful in scenarios where you want to ensure the integrity of a sequence of
14
+ actions or data points, such as in gaming, financial transactions, IoT devices, and more. Please
15
+ go to the homepage for more information about how to use this gem!'
16
+ spec.homepage = 'https://git.pixelridgesoftworks.com/PixelRidge-Softworks/ActionHash'
17
+ spec.license = 'PixelRidge-BEGPULSE'
18
+ spec.required_ruby_version = '>= 3.2.2'
19
+
20
+ spec.metadata['allowed_push_host'] = 'https://git.pixelridgesoftworks.com/api/packages/PixelRidge-Softworks/rubygems'
21
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
22
+
23
+ spec.metadata['homepage_uri'] = spec.homepage
24
+ spec.metadata['source_code_uri'] = 'https://git.pixelridgesoftworks.com/PixelRidge-Softworks/ActionHash'
25
+
26
+ spec.files = Dir.chdir(__dir__) do
27
+ `git ls-files -z`.split("\x0").reject do |f|
28
+ (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
29
+ end
30
+ end
31
+ spec.bindir = 'exe'
32
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ['lib']
34
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Actionhash
4
+ VERSION = '1.0.0'
5
+ end
data/lib/actionhash.rb ADDED
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'actionhash/version'
4
+ require 'securerandom'
5
+
6
+ module ActionHash
7
+ class Error < StandardError; end
8
+
9
+ @key_usage_count = {}
10
+ MAX_ACTIONS_PER_KEY = 10
11
+
12
+ # Generate a new key
13
+ def self.generate_new_key
14
+ SecureRandom.hex(8)
15
+ end
16
+
17
+ # Create a new Action Hash
18
+ def self.create(prev_hash, input_data, key)
19
+ # Check if the key has reached its limit
20
+ @key_usage_count[key] ||= 0
21
+ if @key_usage_count[key] >= MAX_ACTIONS_PER_KEY
22
+ raise Error, 'Key has reached its maximum usage. Please generate a new key.'
23
+ end
24
+
25
+ data = [prev_hash, input_data].join(',')
26
+ encrypted_data = xor_encrypt(data, key)
27
+ encrypted_hex = encrypted_data.unpack1('H*') # Convert to hex
28
+
29
+ # Increment the usage count for the key
30
+ @key_usage_count[key] += 1
31
+
32
+ encrypted_hex
33
+ end
34
+
35
+ # Decrypt an Action Hash to its components
36
+ def self.down_layer(hash, key)
37
+ hex_decoded = [hash].pack('H*') # Convert from hex
38
+ decrypted_data = xor_encrypt(hex_decoded, key)
39
+ prev_hash, input_data = decrypted_data.split(',')
40
+ { prev_hash: prev_hash.to_s, input_data: input_data.to_s }
41
+ end
42
+
43
+ # XOR encrypt/decrypt (symmetric)
44
+ def self.xor_encrypt(data, key)
45
+ data.bytes.zip(key.bytes.cycle).map { |a, b| (a ^ b).chr }.join
46
+ end
47
+
48
+ # Validate if a hash can be traced back to '0'
49
+ def self.valid_hash?(hash, key, level = 20)
50
+ current_level = 0
51
+ loop do
52
+ return false if current_level >= level
53
+
54
+ decrypted_data = down_layer(hash, key)
55
+ return true if decrypted_data[:prev_hash] == '0'
56
+ return false if decrypted_data[:prev_hash].nil? || decrypted_data[:prev_hash].empty?
57
+
58
+ hash = decrypted_data[:prev_hash]
59
+ current_level += 1
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,4 @@
1
+ module Actionhash
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'actionhash' # Update this path to where your ActionHash module is located
4
+
5
+ class ActionHashTest
6
+ def initialize
7
+ @keys = [ActionHash.generate_new_key] # Initialize an array to store keys
8
+ puts "Generated key: #{@keys.last}"
9
+ @hashes = []
10
+ @action_count = 0
11
+ end
12
+
13
+ def run_test(depth)
14
+ prev_hash = '0'
15
+ data = 30
16
+
17
+ depth.times do |i|
18
+ puts "Layer #{i + 1}:"
19
+
20
+ # Check if the key has reached its limit and generate a new one if necessary
21
+ if @action_count >= ActionHash::MAX_ACTIONS_PER_KEY
22
+ @keys << ActionHash.generate_new_key # Generate and store a new key
23
+ puts "Generated new key: #{@keys.last}"
24
+ @action_count = 0
25
+ prev_hash = '0' # Reset prev_hash for the new key
26
+ end
27
+
28
+ current_key = @keys.last # Use the last key in the array
29
+ new_hash = ActionHash.create(prev_hash, data.to_s, current_key)
30
+ puts "Generated hash: #{new_hash}"
31
+ @hashes << { hash: new_hash, key: current_key }
32
+ prev_hash = new_hash
33
+ data *= 2
34
+
35
+ @action_count += 1
36
+ end
37
+
38
+ validate_hashes
39
+ end
40
+
41
+ def validate_hashes
42
+ puts "\nValidating hashes..."
43
+ all_valid = true
44
+ prev_hash = '0' # Initialize prev_hash to '0' as in the run_test method
45
+ current_key_index = 0 # Initialize index to keep track of the current key
46
+
47
+ @hashes.each_with_index do |hash_data, index|
48
+ hash = hash_data[:hash]
49
+ key = hash_data[:key]
50
+
51
+ # Check if we need to switch to the next key
52
+ if current_key_index < @keys.length - 1 && key != @keys[current_key_index]
53
+ current_key_index += 1
54
+ prev_hash = '0' # Reset prev_hash for the new key
55
+ end
56
+
57
+ decrypted_data = ActionHash.down_layer(hash, key)
58
+ puts "Decrypted data: #{decrypted_data[:prev_hash]},#{decrypted_data[:input_data]}"
59
+ puts "Current level: #{index + 1}"
60
+ puts "Current hash: #{hash}"
61
+
62
+ if decrypted_data[:prev_hash] != prev_hash
63
+ puts "Hash at level #{index + 1} is invalid."
64
+ all_valid = false
65
+ break
66
+ end
67
+
68
+ prev_hash = hash # Update prev_hash for the next iteration
69
+ end
70
+
71
+ puts all_valid ? 'All hashes are valid.' : 'Hash validation failed.'
72
+ end
73
+ end
74
+
75
+ if ARGV.length != 1 || !ARGV[0].match?(/^\d+$/)
76
+ puts "Usage: ruby #{__FILE__} [depth]"
77
+ exit 1
78
+ end
79
+
80
+ depth = ARGV[0].to_i
81
+ test = ActionHashTest.new
82
+ test.run_test(depth)
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: actionhash
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - PixelRidge Softworks
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |-
14
+ ActionHash is a Ruby gem designed to validate a series of actions while obfuscating the associated
15
+ data. Its particularly useful in scenarios where you want to ensure the integrity of a sequence of
16
+ actions or data points, such as in gaming, financial transactions, IoT devices, and more. Please
17
+ go to the homepage for more information about how to use this gem!
18
+ email:
19
+ - ceo@pixelridgesoftworks.com
20
+ executables: []
21
+ extensions: []
22
+ extra_rdoc_files: []
23
+ files:
24
+ - ".rspec"
25
+ - ".rubocop.yml"
26
+ - CODE_OF_CONDUCT.md
27
+ - Gemfile
28
+ - Gemfile.lock
29
+ - LICENSE
30
+ - README.md
31
+ - Rakefile
32
+ - actionhash.gemspec
33
+ - lib/actionhash.rb
34
+ - lib/actionhash/version.rb
35
+ - sig/actionhash.rbs
36
+ - tests/hash_generator.rb
37
+ homepage: https://git.pixelridgesoftworks.com/PixelRidge-Softworks/ActionHash
38
+ licenses:
39
+ - PixelRidge-BEGPULSE
40
+ metadata:
41
+ allowed_push_host: https://rubygems.org
42
+ homepage_uri: https://git.pixelridgesoftworks.com/PixelRidge-Softworks/ActionHash
43
+ source_code_uri: https://git.pixelridgesoftworks.com/PixelRidge-Softworks/ActionHash
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.2.2
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubygems_version: 3.4.10
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: A custom hash mechanism for action tracking and validation.
63
+ test_files: []