cfh 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbdb0e6e951c426836f349ce945995dd72a25c7672a27272e37664160fd37803
4
- data.tar.gz: 1ff828295db8caf0b09f4ee7e6c27c86c051d7e1876f5e6f73411ada35d6dd97
3
+ metadata.gz: 3a8ef6b7f1b2c1c37a3f61499b28d9fdc9390f527fd3b37b1f18e7871e91b5a3
4
+ data.tar.gz: 6934573eb2aa338d80392a6fdf6d8bb925798a097293c07e279bca0dff603457
5
5
  SHA512:
6
- metadata.gz: 7656f905c6809477d11e80685bd30812a16e3d1568c15d6c7d1d2cf15f1251593b1cd57d510ed039829975c4149865c7d3a9401a3e402efa32eab4247a814a8d
7
- data.tar.gz: 9227dd97e5d383fe020aa8872d7e9dcc8bc531cae4ff44d7552bc7aa44ea970188a696dce250451438d900f76ccc8b33a252b013a23db3d59aa3426441ce48bb
6
+ metadata.gz: 70984851629dcb46657be4eca59ded84fa5a5248a847970104788683cdedac8f0e6901b4034afca805c070fa6dfcb3d6d0e4d64f47a407966e735708d9ebd0ce
7
+ data.tar.gz: 85f6925e3981190d1fc5ba6ab45f520bda826841d8c3240c93cc60ace397ba53193535c6c3d584ae28a8a96093eb812ce0e839a5a8b0748da37c4eb5b8b6fbd9
data/.gitignore ADDED
@@ -0,0 +1,50 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1 @@
1
+ source 'https://rubygems.org'
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Azim Can KURUCA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,20 @@
1
+
2
+ # Cipher from Human
3
+
4
+ cfh generate password from human information.
5
+
6
+ ## Usage
7
+
8
+ ### Installation
9
+ Add to your Gemfile
10
+
11
+ gem 'cfh'
12
+
13
+ or `gem install cfh`
14
+
15
+ ### Examples
16
+ Now, just initialize a Person object:
17
+
18
+ @person = Person.new
19
+
20
+ This will give you a generic setup of a 16-length, alphanumeric key seperated every 4 characters by a hyphen.
data/cfh.gemspec ADDED
@@ -0,0 +1,15 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'cfh'
3
+ s.version = '0.0.3'
4
+ s.date = '2019-06-18'
5
+ s.summary = "Cipher From Human"
6
+ s.description = "Generate password from person information"
7
+ s.authors = ["Azim Can"]
8
+ s.email = 'azimcankuruca@gmail.com'
9
+
10
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
11
+ f.match(%r{^(test|spec|features)/})
12
+ end
13
+ s.homepage = 'https://rubygems.org/gems/cfh'
14
+ s.license = 'MIT'
15
+ end
data/lib/cfh/hasher.rb ADDED
@@ -0,0 +1,18 @@
1
+ module Cfh
2
+ # Hasher
3
+ class Hasher
4
+ def self.create(person_hash, key_value)
5
+ hash_key = hasher(person_hash)
6
+ data = {
7
+ key_value: key_value,
8
+ hash_key: hash_key
9
+ }
10
+ hasher(data)
11
+ end
12
+
13
+ def self.hasher(data)
14
+ data_json = JSON.pretty_generate(data)
15
+ Digest::SHA256.hexdigest(data_json)
16
+ end
17
+ end
18
+ end
data/lib/cfh/person.rb ADDED
@@ -0,0 +1,26 @@
1
+ module Cfh
2
+ # Kisisel bilgilerin tutuldugu sinif
3
+ class Person
4
+ attr_accessor :no, :surname, :name, :date
5
+
6
+ def initialize(args = {})
7
+ @no = args[:no]
8
+ @surname = args[:surname]
9
+ @name = args[:name]
10
+ @date = args[:date]
11
+ end
12
+
13
+ def hash
14
+ {
15
+ NO: @no,
16
+ SURNAME: @surname,
17
+ NAME: @name,
18
+ DATE: @date
19
+ }
20
+ end
21
+
22
+ def json
23
+ JSON.pretty_generate(hash)
24
+ end
25
+ end
26
+ end
data/lib/cfh.rb CHANGED
@@ -3,7 +3,7 @@ require 'json'
3
3
  require_relative 'cfh/person'
4
4
  require_relative 'cfh/hasher'
5
5
 
6
- # Cipher
6
+ # Cfh
7
7
  module Cfh
8
8
  def self.slicer(value)
9
9
  array = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Azim Can
@@ -16,7 +16,14 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - ".gitignore"
20
+ - Gemfile
21
+ - LICENSE
22
+ - README.md
23
+ - cfh.gemspec
19
24
  - lib/cfh.rb
25
+ - lib/cfh/hasher.rb
26
+ - lib/cfh/person.rb
20
27
  homepage: https://rubygems.org/gems/cfh
21
28
  licenses:
22
29
  - MIT