Class: GameMachine::Uniqueid

Inherits:
Object
  • Object
show all
Defined in:
server/lib/game_machine/uniqueid.rb

Class Method Summary collapse

Class Method Details

.digest(string) ⇒ Object


18
19
20
# File 'server/lib/game_machine/uniqueid.rb', line 18

def digest(string)
  Digest::MD5.hexdigest string
end

.generate_token(id) ⇒ Object


8
9
10
# File 'server/lib/game_machine/uniqueid.rb', line 8

def generate_token(id)
  digest(id + random_salt)
end

.random_saltObject


13
14
15
# File 'server/lib/game_machine/uniqueid.rb', line 13

def random_salt
  SecureRandom.urlsafe_base64
end