mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
14 lines
No EOL
362 B
PHP
14 lines
No EOL
362 B
PHP
<?php
|
|
|
|
class Encoding
|
|
{
|
|
public static function base64EncodeUrlsafe($data)
|
|
{
|
|
return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); // equals sign is just for padding, can be safely removed
|
|
}
|
|
|
|
public static function base64DecodeUrlsafe($data)
|
|
{
|
|
return base64_decode(strtr($data, '-_', '+/')); // dont worry about replacing equals sign
|
|
}
|
|
} |