sasaya/base64url

There is no license information available for the latest version (dev-master) of this package.

dev-master 2023-09-06 10:40 UTC

This package is auto-updated.

Last update: 2024-11-06 12:57:55 UTC


README

An URL safe base64 encode/decode with JSON support.

Build Status Coverage Status

Quick Start

Installation

composer require sasaya/base64url

Usage

use Sasaya\Base64URL;

Base64URL::encode('Hello World');              // string(15) "SGVsbG8gV29ybGQ"
Base64URL::encode(['Hello', 'World']);         // string(23) "WyJIZWxsbyIsIldvcmxkIl0"
Base64URL::encode([]);                         // string(0) ""

Base64URL::decode('SGVsbG8gV29ybGQ');          // string(11) "Hello World"
Base64URL::decode('WyJIZWxsbyIsIldvcmxkIl0');  // array(2) { [0]=> string(5) "Hello" [1]=> string(5) "World" }
Base64URL::decode('');                         // array(0) { }