Class: Faker::Ethereum

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

Constant Summary

Constants inherited from Base

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

Class Method Summary collapse

Methods inherited from Base

bothify, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.addressObject



4
5
6
7
8
9
# File 'lib/faker/ethereum.rb', line 4

def address
  hex_alphabet = '0123456789abcdef'
  var = '0x'
  40.times { var << sample(shuffle(hex_alphabet.split(''))) }
  var
end