h 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/Rakefile +1 -2
- data/VERSION.semver +1 -1
- data/bin/console +1 -1
- data/lib/h.rb +2 -8
- data/test/test_h.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0ae3b158ff41bdca434eaaacd48a2c2e9ebd79d
|
4
|
+
data.tar.gz: e5019914b6044ea05a060636a8778e9d0c128640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9fc33a412e2a2a90f1780c4749c4b7e1fe9a7b547983d40e1685a2ee49afa7f1e40d405fe4e89fff04d6b5b44336c1b578a6341e7cbf73a8dca7d05b323f752
|
7
|
+
data.tar.gz: 45bab5002bd34e05e5116b90bca05f6416744cd75063ebee381bc241441dc3f676f4e1b1824523f350b176545ce29b92e509b55b285ed2bf7910c3e5a6abf011
|
data/README.md
CHANGED
@@ -25,10 +25,10 @@ Generate a digest from the system:
|
|
25
25
|
$ echo "my-secret" > ~/.h
|
26
26
|
|
27
27
|
$ h p@ssw0rd
|
28
|
-
|
28
|
+
+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=
|
29
29
|
|
30
30
|
$ h シークレット
|
31
|
-
|
31
|
+
NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU=
|
32
32
|
```
|
33
33
|
|
34
34
|
Same operations, with Ruby:
|
@@ -38,8 +38,8 @@ require "h"
|
|
38
38
|
|
39
39
|
builder = H::Builder.new("my-secret")
|
40
40
|
|
41
|
-
builder.call("p@ssw0rd") # =>
|
42
|
-
builder.call("シークレット") # =>
|
41
|
+
builder.call("p@ssw0rd") # => +KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=
|
42
|
+
builder.call("シークレット") # => NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU=
|
43
43
|
```
|
44
44
|
|
45
45
|
## Status
|
data/Rakefile
CHANGED
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
4.0.0
|
data/bin/console
CHANGED
data/lib/h.rb
CHANGED
@@ -5,17 +5,11 @@ module H
|
|
5
5
|
attr_reader :secret
|
6
6
|
|
7
7
|
def initialize(secret)
|
8
|
-
@secret = secret
|
8
|
+
@secret = secret
|
9
9
|
end
|
10
10
|
|
11
11
|
def call(value)
|
12
|
-
::Digest::SHA256.
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def salt(value)
|
18
|
-
value + secret
|
12
|
+
::Digest::SHA256.base64digest("#{value}++#{secret}")
|
19
13
|
end
|
20
14
|
end
|
21
15
|
end
|
data/test/test_h.rb
CHANGED
@@ -3,29 +3,29 @@ require_relative '_test_helper'
|
|
3
3
|
Fix.describe H::Builder do
|
4
4
|
on :new, 'my-secret' do
|
5
5
|
on :call, nil do
|
6
|
-
it { MUST eql '
|
6
|
+
it { MUST eql 'NKLNPIzInF96PBmMCqZR1jFaIoHn9c1y0n8jtMam4cs=' }
|
7
7
|
end
|
8
8
|
|
9
9
|
on :call, 'p@ssw0rd' do
|
10
|
-
it { MUST eql '
|
10
|
+
it { MUST eql '+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=' }
|
11
11
|
end
|
12
12
|
|
13
13
|
on :call, 'シークレット' do
|
14
|
-
it { MUST eql '
|
14
|
+
it { MUST eql 'NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU=' }
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
on :new, nil do
|
19
19
|
on :call, nil do
|
20
|
-
it { MUST eql '
|
20
|
+
it { MUST eql 'z8DAYHozgPeXU0azDBSvgoT1ST2XgbDthH9JnwG0do4=' }
|
21
21
|
end
|
22
22
|
|
23
23
|
on :call, 'p@ssw0rd' do
|
24
|
-
it { MUST eql '
|
24
|
+
it { MUST eql 'M1YbuYA4RzKHPYXaUm/GH49wLTA8JOu4WCGbt8QVOrE=' }
|
25
25
|
end
|
26
26
|
|
27
27
|
on :call, 'シークレット' do
|
28
|
-
it { MUST eql '
|
28
|
+
it { MUST eql 'jBU9DIODvHm1tTS7LHHJ1fM/SD3dIgwbYs8sXQkttJw=' }
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Kato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|