Class: DigestTest
- Defined in:
- lib/extensions/ezcrypto/ext/test/digest_test.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_digest ⇒ Object
- #test_digest64 ⇒ Object
- #test_generate_hexkey ⇒ Object
- #test_generate_key ⇒ Object
- #test_generate_key64 ⇒ Object
- #test_get_key ⇒ Object
- #test_hexdigest ⇒ Object
Instance Method Details
#setup ⇒ Object
10 11 |
# File 'lib/extensions/ezcrypto/ext/test/digest_test.rb', line 10 def setup end |
#test_digest ⇒ Object
13 14 15 16 17 |
# File 'lib/extensions/ezcrypto/ext/test/digest_test.rb', line 13 def test_digest ["hello","","test"].each do |data| assert_equal Digest::SHA1.digest(data)[0..15],EzCrypto::Digester.digest(data) end end |
#test_digest64 ⇒ Object
19 20 21 22 23 |
# File 'lib/extensions/ezcrypto/ext/test/digest_test.rb', line 19 def test_digest64 ["hello","","test"].each do |data| assert_equal Base64.encode64(Digest::SHA1.digest(data)[0..15]),EzCrypto::Digester.digest64(data) end end |
#test_generate_hexkey ⇒ Object
42 43 44 45 46 |
# File 'lib/extensions/ezcrypto/ext/test/digest_test.rb', line 42 def test_generate_hexkey key=EzCrypto::Digester.generate_hexkey assert 40,key.size end |
#test_generate_key ⇒ Object
31 32 33 34 |
# File 'lib/extensions/ezcrypto/ext/test/digest_test.rb', line 31 def test_generate_key key=EzCrypto::Digester.generate_key assert 16,key.size end |
#test_generate_key64 ⇒ Object
36 37 38 39 40 |
# File 'lib/extensions/ezcrypto/ext/test/digest_test.rb', line 36 def test_generate_key64 key=EzCrypto::Digester.generate_key64 assert 24,key.size end |
#test_get_key ⇒ Object
48 49 50 |
# File 'lib/extensions/ezcrypto/ext/test/digest_test.rb', line 48 def test_get_key end |