Giter Site home page Giter Site logo

bcmath_compat's Introduction

phpseclib - PHP Secure Communications Library

CI Status

Supporting phpseclib

Introduction

MIT-licensed pure-PHP implementations of the following:

SSH-2, SFTP, X.509, an arbitrary-precision integer arithmetic library, Ed25519 / Ed449 / Curve25519 / Curve449, ECDSA / ECDH (with support for 66 curves), RSA (PKCS#1 v2.2 compliant), DSA / DH, DES / 3DES / RC4 / Rijndael / AES / Blowfish / Twofish / Salsa20 / ChaCha20, GCM / Poly1305

Documentation

Branches

master

  • Development Branch
  • Unstable API
  • Do not use in production

3.0

  • Long term support (LTS) release
  • Major expansion of cryptographic primitives
  • Minimum PHP version: 5.6.1
  • PSR-4 autoloading with namespace rooted at \phpseclib3
  • Install via Composer: composer require phpseclib/phpseclib:~3.0

2.0

  • Long term support (LTS) release
  • Modernized version of 1.0
  • Minimum PHP version: 5.3.3
  • PSR-4 autoloading with namespace rooted at \phpseclib
  • Install via Composer: composer require phpseclib/phpseclib:~2.0

1.0

  • Long term support (LTS) release
  • PHP4 compatible
  • Composer compatible (PSR-0 autoloading)
  • Install using Composer: composer require phpseclib/phpseclib:~1.0
  • Download 1.0.23 as ZIP

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Support

Need Support?

Special Thanks

Special Thanks to our $50+ sponsors!:

Contributing

  1. Fork the Project

  2. Ensure you have Composer installed (see Composer Download Instructions)

  3. Install Development Dependencies

    composer install
  4. Create a Feature Branch

  5. Run continuous integration checks:

    composer run-script all-quality-tools
  6. Send us a Pull Request

bcmath_compat's People

Contributors

terrafrost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bcmath_compat's Issues

can't install on heroku

During an Heroku deployment i get this error :

Your requirements could not be resolved to an installable set of packages.

Problem 1
- don't install phpseclib/bcmath_compat 1.0.3|don't install php 7.3.13
- composer.json/composer.lock requires php 7.3.* -> satisfiable by php[7.3.13].
- Installation request for phpseclib/bcmath_compat 1.0.3 -> satisfiable by phpseclib/bcmath_compat[1.0.3].

The phpseclib/bcmath_compat package is an indirect dependency of laravel/framework via moontoast/math

null arguments

The functions are not handling null arguments the same way as the php extension.
Argument validation raises warnings for null arguments and returns incorrect null value as function result.

print_r(
    array(
        'bcadd(1, 1)' => bcadd(1, 1),
        'bcadd(null, 1)' => bcadd(null, 1),
        'bcadd(1, null)' => bcadd(1, null),
    )
);

Result with php bcmath:

Array
(
    [bcadd(1, 1)] => 2
    [bcadd(null, 1)] => 1
    [bcadd(1, null)] => 1
)

Result with phpseclib/bcmath_compat:

Warning: bcadd() expects parameter 0 to be integer, NULL given in vendor\phpseclib\bcmath_compat\src\BCMath.php on line 418

Warning: bcadd() expects parameter 1 to be integer, NULL given in vendor\phpseclib\bcmath_compat\src\BCMath.php on line 418

Array
(
    [bcadd(1, 1)] => 2
    [bcadd(null, 1)] =>
    [bcadd(1, null)] =>
)

Argument validation should accept null.
Since before method calling non numeric arguments are casted to 0, it is safe to accept null at argument validation.

Compatability with PHP8.3

The polyfill seems to not work with PHP 8.3 and gives a error that module is not present, when I switch back to PHP 8.1 it works as expected

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.