
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
pybiginteger
Advanced tools
![]()
A C++ port of the C# BigInteger class, with bindings for Python.
The default configuration builds a shared library
mkdir build
cd build
cmake ..
cmake --build .
You can define various options during the configure stage to control the output
| Var | Default | Comment |
|---|---|---|
| BIGINTEGER_BUILD_SHARED_LIB | ON | |
| BIGINTEGER_BUILD_STATIC_LIB | OFF | |
| BIGINTEGER_BUILD_TESTING | OFF |
Read here.
Test can be ran as follows
cmake -D BUILD_TESTING=ON ..
cmake --build .
./tests/unit_tests
The output should be similar to
...
[ RUN ] properties.RunMinusOneTests
[ OK ] properties.RunMinusOneTests (2 ms)
[----------] 3 tests from properties (7 ms total)
[----------] Global test environment tear-down
[==========] 117 tests from 22 test suites ran. (17481 ms total)
[ PASSED ] 117 tests.
The project can be included in 2 ways
add_subdirectory(BigIntegerCpp)
or if it has been installed via make install you can use
find_library(bigintegercpp)
It is possible to build both a SHARED and STATIC library simultaneously, as such 2 link targets exists to differentiate between them, respectively
BigIntegerCpp::BigIntegerCpp
BigIntegerCpp::BigIntegerCpp-static
To use in your target add
target_include_directories(your_target PUBLIC ${bigintegercpp_INCLUDE_DIRS})
target_link_libraries(your_target PRIVATE BigIntegerCpp::BigIntegerCpp)
Source.cpp
#include <bigintegercpp/BigInteger.h>
Why this project?
It is purpose build for use in relationship to the NEO blockchain project.
In order to create a compliant port of their virtual machine a need for a compliant BigInteger implementation exists.
Any difference, in for example the modulo implementation, can result in VM execution deviation. This is just one of the many problems we've encountered after attemping to wrap Python's native int to produce identical behaviour.
Should I use this project?
If you have to ask this question, then no.
How fast is it?
We don't know. The focus has been on conformity to the C# BigInteger class, not on speed. If you want speed you might want to look at https://gmplib.org/
Are there any known behavioural deviations from the C# implementation?
The only known deviations are in the string parsing and conversion to string methods. Specifically, the overloads with IFormatProvider are not supported.
Only base10 parsing is supported. String input may be prepended with + or -. Any whitespace is considered the end of the input.
Deviations in any other parts are considered bugs. Please report them.
FAQs
C++ port of the C# BigInteger class
We found that pybiginteger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.