Sha256: 4c9db946386403cc8586fa43e554292c3e157de1a102cee216362bfb97f4067e

Contents?: true

Size: 1.01 KB

Versions: 21

Compression:

Stored size: 1.01 KB

Contents

$:.unshift(File.dirname(__FILE__) + "/../lib/")

require 'test/unit'
require 'ezcrypto'
require 'base64'
require 'digest/sha1'

class DigestTest < Test::Unit::TestCase

  def setup
  end

  def test_digest
    ["hello","","test"].each do |data|
      assert_equal Digest::SHA1.digest(data)[0..15],EzCrypto::Digester.digest(data)
    end
  end
  
  def test_digest64
    ["hello","","test"].each do |data|
      assert_equal Base64.encode64(Digest::SHA1.digest(data)[0..15]),EzCrypto::Digester.digest64(data)
    end    
  end
  
  def test_hexdigest
    ["hello","","test"].each do |data|
      assert_equal Digest::SHA1.hexdigest(data)[0..40],EzCrypto::Digester.hexdigest(data)
    end
  end
  
  def test_generate_key
    key=EzCrypto::Digester.generate_key
    assert 16,key.size
  end
  
  def test_generate_key64
    key=EzCrypto::Digester.generate_key64
    assert 24,key.size
    
  end
  
  def test_generate_hexkey
    key=EzCrypto::Digester.generate_hexkey
    assert 40,key.size
    
  end
  
  def test_get_key
    
  end
end

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
rhodes-7.6.0 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-7.5.1 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-7.4.1 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-7.1.17 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-6.2.0 lib/extensions/ezcrypto/ext/test/digest_test.rb
ezcrypto2-0.0.2 test/digest_test.rb
rhodes-6.0.11 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-5.5.18 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-5.5.17 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-5.5.15 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-5.5.0.22 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-5.5.2 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-5.5.0.7 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-5.5.0.3 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-5.5.0 lib/extensions/ezcrypto/ext/test/digest_test.rb
tauplatform-1.0.3 lib/extensions/ezcrypto/ext/test/digest_test.rb
tauplatform-1.0.2 lib/extensions/ezcrypto/ext/test/digest_test.rb
tauplatform-1.0.1 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-3.5.1.12 lib/extensions/ezcrypto/ext/test/digest_test.rb
rhodes-3.4.2 lib/extensions/ezcrypto/ext/test/digest_test.rb