<p><a href="http://en.wikipedia.org/wiki/SHA-1" rel="noreferrer">SHA Hash functions</a></p>

[{'answer_id': 34514, 'author': 'devstopfix', 'author_id': 3366, 'author_profile': 'https://Stackoverflow.com/users/3366', 'pm_score': 10, 'selected': True, 'text': "<pre><code>require 'digest/sha1'\nDigest::SHA1.hexdigest 'foo'\n</code></pre>\n"}, {'answer_id': 5269105, 'author': 'r4ccoon', 'author_id': 79770, 'author_profile': 'https://Stackoverflow.com/users/79770', 'pm_score': -1, 'selected': False, 'text': '<p>Where \'serialize\' is some user function defined elsewhere.</p>\n\n<pre><code> def generateKey(data)\n    return Digest::SHA1.hexdigest ("#{serialize(data)}")\n end\n</code></pre>\n'}, {'answer_id': 5968830, 'author': 'Thiago Ganzarolli', 'author_id': 287604, 'author_profile': 'https://Stackoverflow.com/users/287604', 'pm_score': 3, 'selected': False, 'text': "<p>For a Base64 encoded hash, to validated an Oauth signature, I used</p>\n\n<pre><code>require 'base64'\nrequire 'hmac-sha1'\n\nBase64.encode64((HMAC::SHA1.new('key') &lt;&lt; 'base').digest).strip\n</code></pre>\n"}, {'answer_id': 19819184, 'author': 'Gregory Ostermayr', 'author_id': 833555, 'author_profile': 'https://Stackoverflow.com/users/833555', 'pm_score': 3, 'selected': False, 'text': '<p>I created a helper <a href="https://rubygems.org/gems/rickshaw" rel="noreferrer">gem</a> which is a simple wrapper around some sha1 code</p>\n\n<pre><code>require \'rickshaw\'\n&gt; Rickshaw::SHA1.hash(\'LICENSE.txt\')\n\n =&gt; "4659d94e7082a65ca39e7b6725094f08a413250a" \n\n&gt; "hello world".to_sha1\n\n =&gt; "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed" \n</code></pre>\n'}]
['https://Stackoverflow.com/questions/34490', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3624/']