Base62
in package
Base62 generator
Class to encode and decode numbers using base62
Tags
Table of Contents
- BASE62_ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
- BASE62_BASE = 62
- decode() : int
- Common base62 decoding function.
- encode() : string
- Common base62 encoding function.
Constants
BASE62_ALPHABET
public
mixed
BASE62_ALPHABET
= '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
BASE62_BASE
public
mixed
BASE62_BASE
= 62
Methods
decode()
Common base62 decoding function.
public
decode(string $base62Number) : int
Implemented here so we don't need additional PHP modules like bcmath.
Parameters
- $base62Number : string
-
Number to decode
Tags
Return values
int —encode()
Common base62 encoding function.
public
encode(string $base10Number) : string
Implemented here so we don't need additional PHP modules like bcmath.
Parameters
- $base10Number : string
-
Number to encode