Class: Faker::Crypto
Constant Summary
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.md5 ⇒ String
Produces an MD5 hash.
-
.sha1 ⇒ String
Produces a SHA1 hash.
-
.sha256 ⇒ String
Produces a SHA256 hash.
-
.sha512 ⇒ String
Produces a SHA512 hash.
Methods inherited from Base
bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale
Class Method Details
.md5 ⇒ String
Produces an MD5 hash.
17 18 19 |
# File 'lib/faker/default/crypto.rb', line 17 def md5 OpenSSL::Digest::MD5.hexdigest(Lorem.characters) end |
.sha1 ⇒ String
Produces a SHA1 hash.
30 31 32 |
# File 'lib/faker/default/crypto.rb', line 30 def sha1 OpenSSL::Digest::SHA1.hexdigest(Lorem.characters) end |
.sha256 ⇒ String
Produces a SHA256 hash.
43 44 45 |
# File 'lib/faker/default/crypto.rb', line 43 def sha256 OpenSSL::Digest::SHA256.hexdigest(Lorem.characters) end |
.sha512 ⇒ String
Produces a SHA512 hash.
56 57 58 |
# File 'lib/faker/default/crypto.rb', line 56 def sha512 OpenSSL::Digest::SHA512.hexdigest(Lorem.characters) end |