rot19 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/rot19.rb +24 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: faa54bd6ba015626c7588b9ac4a9612ab3b93a1f
4
+ data.tar.gz: e6a871f15c8b001710e8bd023ea7c6f0b9a9e16e
5
+ SHA512:
6
+ metadata.gz: cb1115b595c526a4058eeb86d91643d2716519a224bb56bb11a4aae61b847f65d3de520fb194b3e5ce90741dcb22a6f533d0837a203aec54be757c8a3563a973
7
+ data.tar.gz: a9a68bf6ddd3071b51ccb4a29298c124c36e15c2703e27c16f77285039cf98e7c26a7cfe2988f808df7e1ba4ba75525823d51033d4b7d8a02f5bbeb4de994636
data/lib/rot19.rb ADDED
@@ -0,0 +1,24 @@
1
+ class Rot19
2
+ def self.convert(19, alphabet = ('a'..'z').to_a.join)
3
+ i = shift % alphabet.size #I like this
4
+ @decrypt = alphabet
5
+ @encrypt = alphabet[i..-1] + alphabet[0...i]
6
+ end
7
+
8
+ def encrypt(string)
9
+ string.tr(@decrypt, @encrypt)
10
+ end
11
+
12
+ def decrypt(string)
13
+ string.tr(@encrypt, @decrypt)
14
+ end
15
+ end
16
+
17
+ puts "Enter Original Password"
18
+ list = gets
19
+ #original_text = "this is rot19 encryption whoo"
20
+ convert_text = Rot19.new.encrypt(list)
21
+ printf "Original Password is => "
22
+ puts list
23
+ printf "rot19 encryption password is => "
24
+ puts convert_text
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rot19
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Sandeep Chourey
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple gem for Gem for convert String to Rot19(rotation)!
14
+ email: schourey1988@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/rot19.rb
20
+ homepage: http://rubygems.org/gems/rot19
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
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
+ rubyforge_project:
40
+ rubygems_version: 2.4.3
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Gem for convert String to Rot19(rotation)!
44
+ test_files: []