Class: Virgil::Crypto::HashAlgorithm
- Inherits:
-
Object
- Object
- Virgil::Crypto::HashAlgorithm
- Defined in:
- lib/virgil/crypto/hash_algorithm.rb
Overview
Enumeration containing supported Algorithms
Defined Under Namespace
Classes: UnknownAlgorithmException
Constant Summary collapse
- MD5 =
:MD5
- SHA1 =
:SHA1
- SHA224 =
:SHA224
- SHA256 =
:SHA256
- SHA384 =
:SHA384
- SHA512 =
:SHA512
- ALGORITHMS_TO_NATIVE =
{ MD5: Core::VirgilHash::Algorithm_MD5, SHA1: Core::VirgilHash::Algorithm_SHA1, SHA224: Core::VirgilHash::Algorithm_SHA224, SHA256: Core::VirgilHash::Algorithm_SHA256, SHA384: Core::VirgilHash::Algorithm_SHA384, SHA512: Core::VirgilHash::Algorithm_SHA512 }
Class Method Summary collapse
-
.convert_to_native(algorithm) ⇒ Integer
Converts algorithm enum value to native value.
Class Method Details
.convert_to_native(algorithm) ⇒ Integer
Converts algorithm enum value to native value
73 74 75 76 77 78 79 |
# File 'lib/virgil/crypto/hash_algorithm.rb', line 73 def self.convert_to_native(algorithm) if ALGORITHMS_TO_NATIVE.has_key?(algorithm) return ALGORITHMS_TO_NATIVE[algorithm] end raise UnknownAlgorithmException("KeyPairType not found: #{algorithm}") end |