class Faker::Blockchain::Ethereum

Public Class Methods

address() click to toggle source

Produces a random Ethereum wallet address

@return [String]

@example

Faker::Blockchain::Ethereum.address
  #=> "0xd392b0c0500700d02d27ab30805ec80ddd3320ff"

@faker.version 1.9.1

# File lib/faker/blockchain/ethereum.rb, line 17
def address
  hex_alphabet = '0123456789abcdef'
  var = +'0x'
  40.times { var << sample(shuffle(hex_alphabet.split(''))) }
  var
end