Sha256: ff82d940c869f2855f3d49951f69caff0643bb14a83a7e7d708e781f1a00fea1

Contents?: true

Size: 327 Bytes

Versions: 3

Compression:

Stored size: 327 Bytes

Contents

module Zhima
  module Sign
    SIGN_METHOD = 'sha1'.freeze

    def self.sign(str)
      Config.mech_rsa.sign(SIGN_METHOD, str)
    end

    def self.verify?(sign, str)
      decode64_sign = Base64.strict_decode64(sign.to_s)
      Config.zm_rsa.verify(SIGN_METHOD, decode64_sign, str.force_encoding("utf-8"))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zhima-0.3.5 lib/zhima/sign.rb
zhima-0.3.4 lib/zhima/sign.rb
zhima-0.3.3 lib/zhima/sign.rb