Sha256: 1c2eb0b4d5b2d471a730f3408456d8afc95eab95adbfde51f241b813872b7c52
Contents?: true
Size: 443 Bytes
Versions: 2
Compression:
Stored size: 443 Bytes
Contents
require "crx_appid/version" require "openssl" require "digest/sha2" class CrxAppid def calculate(pem) Digest::SHA256.hexdigest(OpenSSL::PKey::RSA.new(pem).public_key.to_der)[0...32].tr('0-9a-f', 'a-p') end def calculate_from_file(pem) calculate(open(pem).read) end class << self def calculate(pem) new.calculate(pem) end def calculate_from_file(pem) new.calculate_from_file(pem) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
crx_appid-0.0.2 | lib/crx_appid.rb |
crx_appid-0.0.1 | lib/crx_appid.rb |