Class: MinioRuby::Digestor
- Inherits:
-
Object
- Object
- MinioRuby::Digestor
- Defined in:
- lib/minio-ruby/digest.rb
Class Method Summary collapse
- .base64(value) ⇒ Object
-
.hexdigest(value) ⇒ Object
calculate sha256 hex digest.
-
.hexhmac(key, value) ⇒ Object
calculate hmac hex digest.
-
.hmac(key, value) ⇒ Object
calculate hmac digest.
Class Method Details
.base64(value) ⇒ Object
21 22 23 |
# File 'lib/minio-ruby/digest.rb', line 21 def self.base64(value) Digest::MD5.base64digest(value) end |
.hexdigest(value) ⇒ Object
calculate sha256 hex digest.
7 8 9 |
# File 'lib/minio-ruby/digest.rb', line 7 def self.hexdigest(value) Digest::SHA256.new.update(value).hexdigest end |
.hexhmac(key, value) ⇒ Object
calculate hmac hex digest.
17 18 19 |
# File 'lib/minio-ruby/digest.rb', line 17 def self.hexhmac(key, value) OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), key, value) end |
.hmac(key, value) ⇒ Object
calculate hmac digest.
12 13 14 |
# File 'lib/minio-ruby/digest.rb', line 12 def self.hmac(key, value) OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), key, value) end |