A C++11 large integer library with effective high performance, simplistic in nature and also clean in the eyes.

BigIntegerCPP

BigIntegerCPP is a C++11 port of large integer library used in CryptoLib4Pascal. It allows mostly parsing of numbers as strings in different bases (2, 8, 10 & 16) and converting them back to string, also in different base as stated above. The advantages of this library is its simplistic nature and cleanliness of code.

Code Example

Here is a sample of code which uses BigIntergerCPP to calc 2^20.

#include <iostream>
#include "Base/BigInteger.h"

using namespae std;

int main()
{
    BigInteger::Boot();
    
    BigInteger two("2");
    BigInteger result = two.Pow(20);
    cout << result.ToString(2) << endl; // output string in Base 2

    return 0;
} // end main

Note: Some other functions you might like

  RabinMillerTest
  IsProbablePrime
  ModInverse (Modular Inverse)
  ModPow (Modular Exponentiation)
  NextProbablePrime
  Negate
  TestBit
  GetLowestSetBit
  SetBit
  ClearBit
  FlipBit
  GCD (Greatest Common Divisor (HCF)) 
  Square 
  AbsoluteValue (Get Absolute Value of a Negative BigInteger)
  Random (PcgRandom)

Tested Enviroments:

Visual Studio 2015.

Unittests:

You can find all the unit tests in the Unittest folder. To run the unit tests, you should have boost library installed in your workstation.

Special Note:

You may have noticed that this library needs to Boot firstly before you can begin to use it else it will crash. So, I wrote a wrapper around the BigInteger library called BigIntegerWrapper for those who feel they might forget to Boot the library before using it.

License

This "Software" is Licensed Under MIT License (MIT) .

Tip Jar

  • 💵 Bitcoin: 1Mcci95WffSJnV6PsYG7KD1af1gDfUvLe6

Conclusion

Special thanks to Xor-el for making this library available in the first place.

Owner
Telepati
I am a passionate Python, Django, C, C++, C#, Dart and PHP programmer.
Telepati
Similar Resources

Source Code for 'Clean C++20' by Stephan Roth

Apress Source Code This repository accompanies Clean C++20 by Stephan Roth (Apress, 2021). Download the files as a zip using the green button, or clon

Dec 24, 2022

Faster Non-Integer Sample Rate Conversion

Faster Non-Integer Sample Rate Conversion

Non-Integer Sample Rate Conversion This repository contains a comparison of sample-rate conversion (SRC) algorithms, with an emphasis on performance f

Jul 5, 2022

Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on OpenGL 1.x-4.x supporting Windows, Linux and Mac OS X.

Visualization Library 2.2 Gallery About Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on the in

Nov 8, 2022

weggli is a fast and robust semantic search tool for C and C++ codebases. It is designed to help security researchers identify interesting functionality in large codebases.

weggli is a fast and robust semantic search tool for C and C++ codebases. It is designed to help security researchers identify interesting functionality in large codebases.

weggli is a fast and robust semantic search tool for C and C++ codebases. It is designed to help security researchers identify interesting functionality in large codebases.

Dec 28, 2022

Diff Match Patch is a high-performance library in multiple languages that manipulates plain text.

The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronizing plain text. Diff: Compare two blocks o

Dec 31, 2022

Flexible, portable, high-performance bit fields C++ library. unsigned a:13 becomes F13 a;

C-plus-plus-library-bit-fields Flexible, portible, high-performance bit fields C++ library. The bit fields are specified with a dummy structure where

Oct 12, 2022

A portable fork of the high-performance regular expression matching library

Vectorscan? A fork of Intel's Hyperscan, modified to run on more platforms. Currently ARM NEON/ASIMD is 100% functional, and Power VSX are in developm

Dec 26, 2022

PHP Encoder, protect PHP scripts in PHP 8 and PHP 7, High Performance, Compitable with X86_64, MIPS, ARM platform and Ubuntu/Centos/OpenWRT system.

What's FRICC2? FRICC2 is a PHP Script encryption tool. When you are developing a commercial software using PHP, the script can be distributed as encry

Dec 12, 2022

Convenient, high-performance RGB color and position control for console output

Convenient, high-performance RGB color and position control for console output

Oof (omnipotent output friend) It's common for C++ programs to write output to the console. But consoles are far more capable than what they are usual

Dec 27, 2022
Arbitrary Precision provides C++ long integer types that behave as basic integer types. This library aims to be intuitive and versatile in usage, rather than fast.

Arbitrary Precision (AP) Cross-platform and cross-standard header-only arbitrary precision arithmetic library. Currently it offers integer types that

Sep 28, 2022
StochFuzz - Sound and Cost-effective Fuzzing of Stripped Binaries by Incremental and Stochastic Rewriting
StochFuzz - Sound and Cost-effective Fuzzing of Stripped Binaries by Incremental and Stochastic Rewriting

StochFuzz: A New Solution for Binary-only Fuzzing StochFuzz is a (probabilistically) sound and cost-effective fuzzing technique for stripped binaries.

Dec 5, 2022
K-Closest Points and Maximum Clique Pruning for Efficient and Effective 3-D Laser Scan Matching (RA-L 2022)
K-Closest Points and Maximum Clique Pruning for Efficient and Effective 3-D Laser Scan Matching (RA-L 2022)

KCP The official implementation of KCP: K-Closest Points and Maximum Clique Pruning for Efficient and Effective 3D Laser Scan Matching, accepted for p

Dec 14, 2022
TAFuzzer: Effective and Efficient Targeted Fuzzing framework for Smart Contract Vulnerability Detection (CCS2022a Under Review).

TAFuzzer An effective and efficient targeted fuzzing framework for smart contract vulnerability detection. Requirements TAFuzzer is supported on Linux

Feb 7, 2022
Open source Splatoon 2 save editor for the Nintendo Switch (NX) built on top of the effective-spoon project
Open source Splatoon 2 save editor for the Nintendo Switch (NX) built on top of the effective-spoon project

Open source Splatoon 2 save editor for the Nintendo Switch (NX) built on top of the effective-spoon project

Sep 16, 2022
An eventing framework for building high performance and high scalability systems in C.

NOTE: THIS PROJECT HAS BEEN DEPRECATED AND IS NO LONGER ACTIVELY MAINTAINED As of 2019-03-08, this project will no longer be maintained and will be ar

Dec 14, 2022
Arduino library for DHT sensors - integer only

DHTINT Arduino library for DHT sensors - integer only Description This is an experimental integer only library, based upon - https://github.com/RobTil

Nov 4, 2022
Blade - A simple, fast, clean, and dynamic language that allows you to develop complex applications quickly.

The Blade Programming Language Quick links: BUILDING | CONTRIBUTING | DOCS | LICENSE | tl;dr Blade is a simple, fast, clean and dynamic language that

Dec 31, 2022
Clean tab-less browser based on webkit2 and GTK4.
Clean tab-less browser based on webkit2 and GTK4.

Rose Browser Simple browser based on webkit2-5.0/GTK4. Showcase Requirements In order to build rose you need gtk4 and webkit2gtk-5.0. In order to use

Jan 2, 2023
A bright opening, a clear sight, a clean slate.

Skylight A bright opening, a clean window. Etymology According to dictionary.com, a "skylight" is: an opening in a roof or ceiling, fitted with glass,

Dec 24, 2022