Download the PHP package codepower/anybase without Composer

On this page you can find all versions of the php package codepower/anybase. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package anybase

anybase-php

Convert non-negative integers (including DB-primary-key big integers) between arbitrary numeric bases using custom alphabets. For URL-friendly ID obfuscation, short codes, and human-readable hashing — not for cryptographic security.

Install

composer require codepower/anybase

PHP 8.1+. Optional: ext-gmp (preferred) or ext-bcmath for integers larger than PHP_INT_MAX.

Quick start

Custom alphabet

Salt (per-environment scrambling)

XOR the integer with a fixed salt so that staging IDs and prod IDs don't visually overlap. This is not encryption — anyone with one plaintext- ciphertext pair can recover the salt.

Padding

Convert between bases

Predefined alphabets

base2 base8 base10 base16 base16Upper base32Rfc4648 base32Hex crockfordBase32 base36 base58Bitcoin base58Flickr base62 base64Url supercellHashtag

Crockford base32 folds I/L → 1 and O → 0 on decode and is case-insensitive.

Supercell hashtag folds I/1 → L, O → 0, B → 8 on decode and is case-insensitive by default. Both behaviors are configurable:

Big integers

For values larger than PHP_INT_MAX (2^63 − 1), install ext-gmp (preferred) or ext-bcmath. The library auto-selects:

  1. Native PHP int when the value fits.
  2. GMP when available.
  3. BCMath as fallback.

Pin a specific backend with ->withBackend(new \Anybase\Backend\NativeBackend()).

Errors

All exceptions implement \Anybase\Exception\AnybaseException. Specific classes: InvalidAlphabetException, InvalidInputException, OverflowException, MissingExtensionException.

Testing

This package uses Pest 2:

composer test

License

MIT.


All versions of anybase with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codepower/anybase contains the following files

Loading the files please wait ...