Sha256: 79075d50cfefc4b708fb4dbe7c441896bdab9582ea6f0df90918d1ca9c617d7d

Contents?: true

Size: 261 Bytes

Versions: 19

Compression:

Stored size: 261 Bytes

Contents

require 'digest/md5'

module Alipay
  module Sign
    class MD5
      def self.sign(key, string)
        Digest::MD5.hexdigest("#{string}#{key}")
      end

      def self.verify?(key, string, sign)
        sign == sign(key, string)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
alipay-0.17.0 lib/alipay/sign/md5.rb
alipay-0.16.0 lib/alipay/sign/md5.rb
alipay-0.15.2 lib/alipay/sign/md5.rb
alipay-0.15.1 lib/alipay/sign/md5.rb
alipay-0.15.0 lib/alipay/sign/md5.rb
yl_alipay-0.15.3 lib/alipay/sign/md5.rb
yl_alipay-0.15.2 lib/alipay/sign/md5.rb
alipay-0.14.0 lib/alipay/sign/md5.rb
alipay-0.13.0 lib/alipay/sign/md5.rb
alipay-0.12.0 lib/alipay/sign/md5.rb
alipay-0.11.0 lib/alipay/sign/md5.rb
alipay-0.10.0 lib/alipay/sign/md5.rb
alipay-0.9.0 lib/alipay/sign/md5.rb
alipay-0.8.0 lib/alipay/sign/md5.rb
alipay-0.7.1 lib/alipay/sign/md5.rb
alipay-0.7.0 lib/alipay/sign/md5.rb
alipay-0.6.0 lib/alipay/sign/md5.rb
alipay-0.6.0.beta3 lib/alipay/sign/md5.rb
alipay-0.6.0.beta2 lib/alipay/sign/md5.rb