Class: Faker::Crypto

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/crypto.rb

Constant Summary

Constants inherited from Base

Base::Letters, Base::Numbers, Base::ULetters

Class Method Summary collapse

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

.md5Object


8
9
10
# File 'lib/faker/default/crypto.rb', line 8

def md5
  Digest::MD5.hexdigest(Lorem.characters)
end

.sha1Object


12
13
14
# File 'lib/faker/default/crypto.rb', line 12

def sha1
  Digest::SHA1.hexdigest(Lorem.characters)
end

.sha256Object


16
17
18
# File 'lib/faker/default/crypto.rb', line 16

def sha256
  Digest::SHA256.hexdigest(Lorem.characters)
end