first commit
This commit is contained in:
18
lib/Security/Encodes.php
Normal file
18
lib/Security/Encodes.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Yeepay\Yop\Sdk\Security;
|
||||
|
||||
class Encodes
|
||||
{
|
||||
|
||||
public static function base64url_encode($data)
|
||||
{
|
||||
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
|
||||
}
|
||||
|
||||
public static function base64url_decode($data)
|
||||
{
|
||||
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user