Sha256: db3e47dcceab25e93d887e591288bed34108b8a9e7194bd999461666c3ddcbd8
Contents?: true
Size: 548 Bytes
Versions: 8
Compression:
Stored size: 548 Bytes
Contents
module GoogleSafeBrowsing class KeyHelper def self.web_safe_base64_decode(str) str.tr!('-_', '+/') str << '=' while str.length % 4 != 0 Base64.decode64(str) end def self.web_safe_base64_encode(str) str = Base64.encode64(str).chomp str.tr('+/', '-_') end def self.compute_mac_code(data) sha1 = OpenSSL::HMAC.digest('sha1', GoogleSafeBrowsing.config.client_key, data) web_safe_base64_encode sha1 end end end
Version data entries
8 entries across 8 versions & 1 rubygems