Download the PHP package dynoser/base85 without Composer

On this page you can find all versions of the php package dynoser/base85. 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 base85

vc85 Encoding (base85vc)

vc85 encoding is a variant of base85 (85-character chatset) and is compatible with ASCII85.

vc85: An Improved Version of ASCII85 Encoding

The enhancement lies in the addition of alternative characters to the character set, which function identically to the "primary" ASCII85 characters. The vc85 decoder is backward-compatible with ASCII85 and can decode both ASCII85 and vc85 encodings.

The vc85 character set is designed so that character codes in utf-8 and cp1251 do not overlap. Therefore, the decoder can handle all possible variants of base85, including ascii85, vwx85, and vc85. The differences between these encoding variants are as follows:

Charset

Understanding Base-85 Encoding

Base85 encoding encodes groups of 4 bytes into 5 characters, making it more compact than base64, which encodes groups of 3 bytes into 4 characters.

Implementing base85 encoding is straightforward in most programming languages. It operates on 4-byte groups that fit into 32-bit numbers, making them easy to handle compared to higher-bit numbers.

While base85 encoding could replace base64 in many scenarios, the presence of special characters complicates its use. It's not as simple as enclosing an ascii85-encoded string in quotes and inserting it into code because the string may contain quotes, backslashes, and other problematic characters.

The vwx85 variant partly addresses this issue by removing quotes and backslashes from the character set since these characters often cause problems. This substitution makes it possible to include such data almost anywhere without issues. Since the characters v, w, and x are not used in the classic ascii85 variant, this substitution seems a logical solution to many problems.

Characters z and y

As historically, the characters z and y were used to encode 5 null bytes and 5 spaces, respectively, the vc85 decoder also supports these rules.

Prefixes and Suffixes

Since the base85 character set does not include the tilde ~, it can be used as a marker to indicate the end of encoded data. In the complete format, data in base85 encoding is enclosed between <~ at the beginning and ~> at the end of the encoded data block.

The current vc85 decoder implementation trims decoded data based on these prefixes and suffixes. If <~ is found in the data, all preceding data will be discarded. Similarly, if ~> is encountered, all subsequent data will be discarded.

Whitespace Characters

Spaces and line breaks are ignored and can appear anywhere.

Representations in utf-8 and cp1251

The Cyrillic characters added to the vc85 charset can be represented in utf-8 or cp1251 encodings. The decoder understands both variants. It's worth noting that in cp1251, all characters are represented by 1-byte codes, while in utf-8, Cyrillic characters are represented by two-byte codes (starting either with 208 or 209). In this implementation, when decoding utf-8, codes 208 and 209 are removed, resulting in one-byte encoding. Therefore, no conversions between utf-8 and cp1251 are required.

Usage (for PHP)

To use vc85, simply include the file vc85.php.

For encoding data, use the static function encode, and for decoding, use the static function decode.

Example code:

The result will be something like: <~БfЪMaфCnoЦФю~>

Control Over Prefixes

To disable or enable the addition of <~ ... ~> at the beginning and end:

Control Over Line Breaks

To output the encoder result in one line (without breaks) set 0, or for line breaks at a specified width, set a number to the static variable $splitWidth:

Choosing Encoding Mode

To initialize the encoder for the desired charset, call init with a parameter. Options:


All versions of base85 with dependencies

PHP Build Version
Package Version
No informations.
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 dynoser/base85 contains the following files

Loading the files please wait ....