Module: RbNaCl::Sodium::Version

Extended by:
RbNaCl::Sodium
Defined in:
lib/rbnacl/sodium/version.rb

Overview

libsodium version API

Constant Summary collapse

MINIMUM_LIBSODIUM_VERSION =
[0, 4, 3].freeze
MINIMUM_LIBSODIUM_VERSION_FOR_ARGON2 =
[1, 0, 9].freeze
STRING =
sodium_version_string
INSTALLED_VERSION =
[MAJOR, MINOR, PATCH].freeze
ARGON2_SUPPORTED =
(INSTALLED_VERSION <=> MINIMUM_LIBSODIUM_VERSION_FOR_ARGON2) == -1 ? false : true

Class Method Summary collapse

Methods included from RbNaCl::Sodium

primitive, sodium_constant, sodium_function, sodium_function_with_return_code, sodium_primitive, sodium_type

Class Method Details

.supported_version?(version) ⇒ Boolean

Determine if a given feature is supported based on Sodium version

Returns:

  • (Boolean)


29
30
31
# File 'lib/rbnacl/sodium/version.rb', line 29

def self.supported_version?(version)
  Gem::Version.new(sodium_version_string) >= Gem::Version.new(version)
end