Download the PHP package sam-it/compress-numbers without Composer
On this page you can find all versions of the php package sam-it/compress-numbers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sam-it/compress-numbers
More information about sam-it/compress-numbers
Files in sam-it/compress-numbers
Download sam-it/compress-numbers
More information about sam-it/compress-numbers
Files in sam-it/compress-numbers
Vendor sam-it
Package compress-numbers
Short Description Specialized library to compress a list of nubers for use in REST URLs
License MIT
Package compress-numbers
Short Description Specialized library to compress a list of nubers for use in REST URLs
License MIT
Please rate this library. Is it a good library?
Informations about the package compress-numbers
compress-numbers
Specialized library to compress a list of numbers for use in REST URLs
Use case
When having multiple IDs in URLs and alternatives like using POST
are not preferable this library can help you by compressing arrays of numbers.
The performance of compression depends on the types of numbers found in the array.
Algorithm.
- Sort the numbers
- Replace consecutive numbers by ranges (
[200, 201, 202, 205]
becomes[[200, 202], [205]]
). - For each range find a factor that is a multiple of 100.
The end result looks like this: 2X0T2N5
All versions of compress-numbers with dependencies
PHP Build Version
Package Version
No informations.
The package sam-it/compress-numbers contains the following files
Loading the files please wait ....