File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ require 'base64'
2+
3+ Base64 . module_eval do
4+
5+ def self . strict_encode64 ( bin )
6+ [ bin ] . pack ( "m0" )
7+ end unless defined? Base64 . strict_encode64
8+
9+ def self . urlsafe_encode64 ( bin )
10+ strict_encode64 ( bin ) . tr ( "+/" , "-_" )
11+ end unless defined? Base64 . urlsafe_encode64
12+
13+ def self . strict_decode64 ( str )
14+ str . unpack ( "m0" ) . first
15+ end unless defined? Base64 . strict_decode64
16+
17+ def self . urlsafe_decode64 ( str )
18+ strict_decode64 ( str . tr ( "-_" , "+/" ) )
19+ end unless defined? Base64 . urlsafe_decode64
20+
21+ end
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def test_read_pem2
5151 #puts signature.inspect
5252 end
5353
54- require 'base64'
54+ require File . expand_path ( 'base64.rb' , File . dirname ( __FILE__ ) )
5555
5656 def test_encrypt
5757 p256dh = "BNFege3oh74znsDbVkGf5CRAtLVUHlo5NTU9-inepE_HpUBWUq3FP_dJR-WDORPvKL7fM_AKyfYch-nKY7kDOe0="
You can’t perform that action at this time.
0 commit comments