kryuu-common / base64-url
This is a simple library for encoding and decoding Base64Url, the basis of this is that the Base64 is not URL safe due to the characters `+`, `/` and `=`, so this encode replaces these characters with `=` to ``, `+` to `-` and `/` to `_` for the purpose of using it in the URL
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/kryuu-common/base64-url
Requires (Dev)
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2025-10-18 04:47:03 UTC
README
This is a simple library for encoding and decoding Base64Url, the basis of this
is that the Base64 is not URL safe due to the characters +
, /
and =
, so this
encode replaces these characters with =
to
(nothing), +
to -
and /
to _
for
the purpose of using it in the URL.
Installation
composer require kryuu-common/base64-url
Usage
encode
<?php use KryuuCommon\Base64Url\Base64Url; echo Base64Url::encode('¹º»¼½¾¿À');
output
wrnCusK7wrzCvcK-wr_DgA
decode
<?php use KryuuCommon\Base64Url\Base64Url; echo Base64Url::decode('wrnCusK7wrzCvcK-wr_DgA');
output
¹º»¼½¾¿À