hanifx 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/hanifx.rb +47 -0
- metadata +42 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 3ad418b498d23545f0475b8ae47412e091e40de822e030b5adf9ec0b53823285
|
|
4
|
+
data.tar.gz: 9447bece46f00bfce146ade8f86f381785532aabdf7753f416d0aa4ca8827658
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9a4b8935fde52ffaffd7edfb6c9880c28c0c8eac604cdfdaff05e0810f8e2f81bbd8bd212a6cd54924c22dff985bae95940bf9cca37d57f94de7191fc558bd9b
|
|
7
|
+
data.tar.gz: fef3535d0ba11dd20d6cf2a5614e81082a5679fa265dc429b00bec7d368b9a4eb597e973ee01253df4249e98cd41bba0c0d13e933a05d445dcedee6601880d51
|
data/lib/hanifx.rb
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# lib/hanifx.rb
|
|
2
|
+
|
|
3
|
+
module Hanifx
|
|
4
|
+
VERSION = "0.1.0"
|
|
5
|
+
|
|
6
|
+
# Warning message
|
|
7
|
+
def self.warning
|
|
8
|
+
puts "[WARNING] Once encoded, this data cannot be decoded. Proceed? (yes/no)"
|
|
9
|
+
answer = gets.chomp.downcase
|
|
10
|
+
exit unless answer == "yes"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Irreversible encode for text
|
|
14
|
+
def self.encode_text(text)
|
|
15
|
+
warning
|
|
16
|
+
# Simple irreversible algorithm example: char shuffle + unicode offset
|
|
17
|
+
text.chars.map { |c| ((c.ord + 7) * 3).to_s(16) }.join("-")
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Irreversible encode for file
|
|
21
|
+
def self.encode_file(file_path)
|
|
22
|
+
warning
|
|
23
|
+
unless File.exist?(file_path)
|
|
24
|
+
puts "File not found: #{file_path}"
|
|
25
|
+
return
|
|
26
|
+
end
|
|
27
|
+
content = File.read(file_path)
|
|
28
|
+
encoded = encode_text(content)
|
|
29
|
+
File.write(file_path + ".hanifx", encoded)
|
|
30
|
+
puts "File encoded successfully: #{file_path}.hanifx"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Optional: check script safety for GitHub push
|
|
34
|
+
def self.check_script(file_path)
|
|
35
|
+
unless File.exist?(file_path)
|
|
36
|
+
puts "File not found: #{file_path}"
|
|
37
|
+
return
|
|
38
|
+
end
|
|
39
|
+
# Basic safety: ensure file can be required without error
|
|
40
|
+
begin
|
|
41
|
+
load file_path
|
|
42
|
+
puts "Script is safe to run on terminal/GitHub"
|
|
43
|
+
rescue => e
|
|
44
|
+
puts "Error detected in script: #{e.message}"
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: hanifx
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Hanif
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 2025-09-18 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: Encode text, files, and scripts irreversibly. Warning before use. GitHub
|
|
13
|
+
push safe.
|
|
14
|
+
email:
|
|
15
|
+
- sajim4653@gmail.com
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/hanifx.rb
|
|
21
|
+
homepage: https://github.com/hanifx-540
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
rdoc_options: []
|
|
26
|
+
require_paths:
|
|
27
|
+
- lib
|
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
34
|
+
requirements:
|
|
35
|
+
- - ">="
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
requirements: []
|
|
39
|
+
rubygems_version: 3.6.2
|
|
40
|
+
specification_version: 4
|
|
41
|
+
summary: Hanifx Enc Module - irreversible encoding for text and files
|
|
42
|
+
test_files: []
|