Module: SpeechCloud::GetMd5

Defined in:
lib/speechcloud/get_md5.rb

Class Method Summary collapse

Class Method Details

.formula(token) ⇒ Object

Formula for md5 param is: md5( md5( api_key ) + token )



9
10
11
12
13
# File 'lib/speechcloud/get_md5.rb', line 9

def formula(token)
  api_key = SpeechCloud::Config.api_key
  api_key_as_md5 = to_md5( api_key )
  to_md5( api_key_as_md5 + token )
end

.to_md5(a_string) ⇒ Object

Helper method to transform a string to MD5



4
5
6
# File 'lib/speechcloud/get_md5.rb', line 4

def to_md5(a_string)
  Digest::MD5.hexdigest(a_string)
end