rotation19 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.
- checksums.yaml +7 -0
- data/lib/rotation19.rb +23 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9aa6e8ffd09f4bfc68290c137c15a4e59b02279d
|
4
|
+
data.tar.gz: 3f03601b8b168bb60b53a3c0709484a20d2493bc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 65b09bd045a68ec0bced2e47afdd9e09da77b0c81cbc842f6401b55e4b764a35d93bacbdb1a6aba69d8a8f9136c72a5f4d683b106b1d7c6239f12fdb6d207edb
|
7
|
+
data.tar.gz: 116f0062a3ff91089d849d5a4153874b762906b268239c44b072c7078b15f010b300f5f3da9d375100ff4af9398a759fd97000a6cd5d7ed369957018f5f2b0e0
|
data/lib/rotation19.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
class Rotation
|
2
|
+
def initialize(alphabet = ('a'..'z').to_a.join)
|
3
|
+
shift = 19
|
4
|
+
i = shift % alphabet.size #I like this
|
5
|
+
@decrypt = alphabet
|
6
|
+
@encrypt = alphabet[i..-1] + alphabet[0...i]
|
7
|
+
end
|
8
|
+
|
9
|
+
def encrypt(string)
|
10
|
+
string.tr(@decrypt, @encrypt)
|
11
|
+
end
|
12
|
+
|
13
|
+
def decrypt(string)
|
14
|
+
string.tr(@encrypt, @decrypt)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
puts "Enter Original Password"
|
19
|
+
list = gets
|
20
|
+
convert_text = Rotation.new.encrypt(list)
|
21
|
+
printf "rot19 encryption Password is => "
|
22
|
+
puts convert_text
|
23
|
+
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rotation19
|
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 Rotation19(rotation)!
|
14
|
+
email: schourey1988@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/rotation19.rb
|
20
|
+
homepage: http://rubygems.org/gems/rotation19
|
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 Rotation19(Rotation)!
|
44
|
+
test_files: []
|