btcruby 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/btcruby/hash_functions.rb +6 -3
- data/lib/btcruby/version.rb +1 -1
- 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: 47f8d99f965f48b15252c34e99721b005d2eed0d
|
4
|
+
data.tar.gz: a364c03eccb5174fe5f110f466bac5e3f147b68c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4161f2211ab6fce89f3e56d2ceef2eb977ffb55c71279ae94e52633b54e06a241ded2607e66db06d945c421e7d05d0ed519daeda839781c87a3b896b261c38ea
|
7
|
+
data.tar.gz: d21def19c9077a78da729fe3604582fb2144607569a9cf85551a73891267967f92e583307ec98fd612f94b1dde6910521751eb5ed89d88ffbe9e767427ddf5f5
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'digest/sha1'
|
2
2
|
require 'digest/sha2'
|
3
3
|
require 'digest/rmd160'
|
4
|
-
require '
|
4
|
+
require 'openssl'
|
5
5
|
|
6
6
|
module BTC
|
7
7
|
|
@@ -40,14 +40,17 @@ module BTC
|
|
40
40
|
ripemd160(sha256(data))
|
41
41
|
end
|
42
42
|
|
43
|
+
OPENSSL_DIGEST_NAME_SHA256 = 'sha256'.freeze
|
44
|
+
OPENSSL_DIGEST_NAME_SHA512 = 'sha512'.freeze
|
45
|
+
|
43
46
|
def hmac_sha256(data: nil, key: nil)
|
44
47
|
raise ArgumentError, "Data is missing" if !data || !key
|
45
|
-
|
48
|
+
::OpenSSL::HMAC.digest(OPENSSL_DIGEST_NAME_SHA256, key, data)
|
46
49
|
end
|
47
50
|
|
48
51
|
def hmac_sha512(data: nil, key: nil)
|
49
52
|
raise ArgumentError, "Data is missing" if !data || !key
|
50
|
-
|
53
|
+
::OpenSSL::HMAC.digest(OPENSSL_DIGEST_NAME_SHA512, key, data)
|
51
54
|
end
|
52
55
|
|
53
56
|
end
|
data/lib/btcruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: btcruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Andreev
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
174
|
rubyforge_project: btcruby
|
175
|
-
rubygems_version: 2.
|
175
|
+
rubygems_version: 2.4.5
|
176
176
|
signing_key:
|
177
177
|
specification_version: 4
|
178
178
|
summary: Ruby library for interacting with Bitcoin.
|