Skip to content

Commit

Permalink
Merge pull request #66 from muflihun/develop
Browse files Browse the repository at this point in the history
Updated
  • Loading branch information
abumq authored Nov 24, 2018
2 parents a0c51fa + 83ea372 commit 65bd24d
Show file tree
Hide file tree
Showing 23 changed files with 186 additions and 128 deletions.
6 changes: 3 additions & 3 deletions ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
```
The MIT License (MIT)
Copyright (c) 2012-2018 Muflihun Labs
Copyright (c) 2012-2018 Zuhd Web Services
Copyright (c) 2012-2018 @abumusamq
https://github.com/muflihun/
https://muflihun.github.io
https://github.com/zuhd-org/
https://zuhd.org
https://muflihun.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [2.1.4] - 24-11-2018
- Updated license
- Updated Easylogging++ to 9.96.7

## [2.1.3] - 07-09-2018
### Updated
- Updated Easylogging++ to 9.96.5
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ option (special_edition "Special edition build" OFF)

set (RESIDUE_MAJOR "2")
set (RESIDUE_MINOR "1")
set (RESIDUE_PATCH "3")
set (RESIDUE_PATCH "4")

set (RESIDUE_SOVERSION "${RESIDUE_MAJOR}.${RESIDUE_MINOR}.${RESIDUE_PATCH}")
set (RESIDUE_NAME "Residue-C++")
Expand Down Expand Up @@ -190,4 +190,3 @@ if (test)

add_test (NAME residueCppUnitTests COMMAND residue-cpp-unit-tests)
endif() ## test

5 changes: 3 additions & 2 deletions FindResidue.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#
# Specify ${RESIDUE_ROOT} if you wish to specify root path manually, e.g, -DRESIDUE_ROOT=/usr/local
#
# (c) 2017-present Muflihun Labs
# (c) 2017-present Zuhd Web Services
# (c) 2017-present @abumusamq
#
# https://github.com/muflihun/residue-cpp
# https://github.com/zuhd-org/residue-cpp
# https://zuhd.org
# https://muflihun.com
#

Expand Down
7 changes: 3 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Copyright 2017-present Muflihun Labs
Copyright 2017-present Zuhd Web Services
Copyright 2017-present @abumusamq

https://github.com/muflihun/
https://github.com/zuhd-org/
https://muflihun.com/
https://muflihun.github.io/
https://zuhd.org

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -16,4 +16,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

61 changes: 32 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@

# Residue C++ Client
Official C++ client library with feature-rich API to interact with residue seamlessly. It uses [Easylogging++](https://github.com/muflihun/easyloggingpp) to interact and take input from the user. Easylogging++ is highly efficient, well-tested library.
Official C++ client library with feature-rich API to interact with residue seamlessly. It uses [Easylogging++](https://github.com/zuhd-org/easyloggingpp) to interact and take input from the user. Easylogging++ is highly efficient, well-tested library.

[![Build Status](https://img.shields.io/travis/muflihun/residue-cpp/master.svg)](https://travis-ci.org/muflihun/residue-cpp) [![Build Status](https://img.shields.io/travis/muflihun/residue-cpp/develop.svg)](https://travis-ci.org/muflihun/residue-cpp) [![Version](https://img.shields.io/github/release/muflihun/residue-cpp.svg)](https://github.com/muflihun/residue-cpp/releases/latest) [![Documentation](https://img.shields.io/badge/docs-doxygen-blue.svg)](https://muflihun.github.io/residue/docs/annotated.html) [![Apache-2.0 license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/muflihun/residue-cpp/blob/master/LICENCE) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/MuflihunDotCom/25)
[![Build Status](https://img.shields.io/travis/zuhd-org/residue-cpp/master.svg)](https://travis-ci.org/zuhd-org/residue-cpp) [![Build Status](https://img.shields.io/travis/zuhd-org/residue-cpp/develop.svg)](https://travis-ci.org/zuhd-org/residue-cpp) [![Version](https://img.shields.io/github/release/zuhd-org/residue-cpp.svg)](https://github.com/zuhd-org/residue-cpp/releases/latest) [![Documentation](https://img.shields.io/badge/docs-doxygen-blue.svg)](https://muflihun.github.io/residue/docs/annotated.html) [![Apache-2.0 license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/zuhd-org/residue-cpp/blob/master/LICENCE)

[![Donate](https://muflihun.github.io/donate.png?v2)](https://www.paypal.me/zuhd/25)

## Getting Started
This library is based on single source file. It automatically includes `<residue/easylogging++.h>` header and expect it to be available on developer's system. Please refer to [documentation page](https://muflihun.github.io/residue/docs/class_residue.html) to check the API.

Please refer to [samples directory](/samples/) to get started

## Download Binary
You can download binary from [releases](https://github.com/muflihun/residue-cpp/releases) page for your platform. They are standalone libraries with dependency on `libz` that usually comes with operating system distribution.
You can download binary from [releases](https://github.com/zuhd-org/residue-cpp/releases) page for your platform. They are standalone libraries with dependency on `libz` that usually comes with operating system distribution.

* Download binaries archive for your platform
* Download headers archive
* Unzip binary archives and copy them to `/usr/local/lib/`
* Unzip header archives and copy them to `/usr/local/include/residue/`
For ease, we have setup [`install.sh`](https://github.com/muflihun/residue-cpp/blob/master/install.sh) that you can use to install it locall

For ease, we have setup [`install.sh`](https://github.com/zuhd-org/residue-cpp/blob/master/install.sh) that you can use to install it locall

```
sh -c "$(curl -fsSL https://raw.githubusercontent.com/muflihun/residue-cpp/master/install.sh)"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/zuhd-org/residue-cpp/master/install.sh)"
```

You should be ready to link your application against `libresidue`, both statically and dynamically.

If you use cmake, you may also be interested in [Residue CMake module](https://github.com/muflihun/residue-cpp/blob/master/FindResidue.cmake)
If you use cmake, you may also be interested in [Residue CMake module](https://github.com/zuhd-org/residue-cpp/blob/master/FindResidue.cmake)

### Undefined Reference

Expand All @@ -44,14 +46,14 @@ If you do not wish to download binaries, you can build your own library using fo

### Dependencies
* C++11 compiler (or higher)
* [Crypto++](https://www.cryptopp.com/) v5.6.5+ [with Pem Pack](https://raw.githubusercontent.com/muflihun/muflihun.github.io/master/downloads/pem_pack.zip)
* [Crypto++](https://www.cryptopp.com/) v5.6.5+ [with Pem Pack](https://muflihun.github.io/downloads/pem_pack.zip)
* [zlib-devel](https://zlib.net/)

### Get The Code
You can either [download code from master branch](https://github.com/muflihun/residue-cpp/archive/master.zip) or clone it using `git`:
You can either [download code from master branch](https://github.com/zuhd-org/residue-cpp/archive/master.zip) or clone it using `git`:

```
git clone [email protected]:muflihun/residue-cpp.git
git clone [email protected]:zuhd-org/residue-cpp.git
```

### Build
Expand All @@ -73,7 +75,7 @@ You can change following options in CMake (using `-D<option>=ON`)
| ------------ | ------------------------------- |
| `test` | Compile unit tests |
| `build_sample_app` | Builds detailed-cmake sample |
| `special_edition` | Build [special edition](https://github.com/muflihun/residue/blob/master/docs/INSTALL.md#special-edition) |
| `special_edition` | Build [special edition](https://github.com/zuhd-org/residue/blob/master/docs/INSTALL.md#special-edition) |

### Run Tests
Please consider running unit test before you move on
Expand Down Expand Up @@ -115,10 +117,10 @@ sudo cp -a include/gtest /usr/include
sudo cp -a libgtest_main.so libgtest.so /usr/lib/
## Crypto++
wget https://raw.githubusercontent.com/muflihun/muflihun.github.io/master/downloads/cryptocpp.tar.gz
wget https://muflihun.github.io/downloads/cryptocpp.tar.gz
tar xf cryptocpp.tar.gz
cd cryptopp-CRYPTOPP_5_6_5
wget https://raw.githubusercontent.com/muflihun/muflihun.github.io/master/downloads/pem_pack.zip
wget https://muflihun.github.io/downloads/pem_pack.zip
unzip pem_pack.zip
cmake .
make
Expand All @@ -139,36 +141,36 @@ sh ../tools/package.sh linux 1.1.0 # specify version carefully to match with wha
This will create:
* `libresidue-1.1.0-x86_64-linux.tar.gz`
* `libresidue-1.1.0-static-x86_64-linux.tar.gz`

Second one (`libresidue-1.1.0-static-x86_64-linux.tar.gz`) contains static library that is fully independent.

### Strip
You can take advantage [`strip`](https://linux.die.net/man/1/strip) if you wish to link your application statically. This will reduce binary size significantly.
You can take advantage [`strip`](https://linux.die.net/man/1/strip) if you wish to link your application statically. This will reduce binary size significantly.

## Build Matrix

| Branch | Platform | Build Status |
| -------- |:------------:|:------------:|
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `clang++` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/develop/1)](https://travis-ci.org/muflihun/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-4.9` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/develop/2)](https://travis-ci.org/muflihun/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-5` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/develop/3)](https://travis-ci.org/muflihun/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-6` | [![Build Status](https://travis-matrix-badges.herokuapp.com`/repos/muflihun/residue-cpp/`branches/develop/4)](https://travis-ci.org/muflihun/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-7` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/develop/5)](https://travis-ci.org/muflihun/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `clang++` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/master/1)](https://travis-ci.org/muflihun/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-4.9` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/master/2)](https://travis-ci.org/muflihun/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-5` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/master/3)](https://travis-ci.org/muflihun/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-6` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/master/4)](https://travis-ci.org/muflihun/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-7` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/residue-cpp/branches/master/5)](https://travis-ci.org/muflihun/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `clang++` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/develop/1)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-4.9` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/develop/2)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-5` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/develop/3)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-6` | [![Build Status](https://travis-matrix-badges.herokuapp.com`/repos/zuhd-org/residue-cpp/`branches/develop/4)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-7` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/develop/5)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `clang++` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/master/1)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-4.9` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/master/2)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-5` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/master/3)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-6` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/master/4)](https://travis-ci.org/zuhd-org/residue-cpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-7` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/zuhd-org/residue-cpp/branches/master/5)](https://travis-ci.org/zuhd-org/residue-cpp) |

## License

```
Copyright 2017-present Muflihun Labs
Copyright 2017-present Zuhd Web Services
Copyright 2017-present @abumusamq
https://github.com/muflihun/
https://muflihun.github.io/
https://github.com/zuhd-org/
https://muflihun.com/
https://zuhd.org
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -181,4 +183,5 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
6 changes: 3 additions & 3 deletions deps/ripe/LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Copyright 2017 Muflihun Labs
Copyright 2017-present Zuhd Web Services

https://github.com/muflihun/
https://github.com/zuhd-org/
https://muflihun.com
https://zuhd.org

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -14,4 +15,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

28 changes: 23 additions & 5 deletions deps/ripe/Ripe.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//
// Ripe
//
// Copyright 2017-present Muflihun Labs
// Copyright 2017-present Zuhd Web Services
//
// https://muflihun.com/
// https://muflihun.github.io/ripe/
// https://github.com/muflihun/ripe
// https://muflihun.com
// https://zuhd.org
// https://github.com/zuhd-org/ripe
//
// Author: @abumusamq
//
Expand Down Expand Up @@ -38,10 +38,12 @@
#include <cryptopp/hex.h>
#include <cryptopp/pem.h>
#include <cryptopp/rsa.h>
#include <cryptopp/sha.h>
#include <cryptopp/filters.h>

#include <zlib.h>

#include "Ripe.h"
#include "../include/Ripe.h"

#define RIPE_UNUSED(x) (void)x

Expand Down Expand Up @@ -507,6 +509,22 @@ std::string Ripe::decompressString(const std::string& str)
return outstring;
}

std::string Ripe::sha256Hash(const std::string& data)
{
std::string digest;
SHA256 hasher;
StringSource ss(data, true, new HashFilter(hasher, new HexEncoder(new StringSink(digest))));
return digest;
}

std::string Ripe::sha512Hash(const std::string& data)
{
std::string digest;
CryptoPP::SHA512 hasher;
StringSource ss(data, true, new HashFilter(hasher, new HexEncoder(new StringSink(digest))));
return digest;
}

std::string Ripe::prepareData(const std::string& data, const std::string& hexKey, const char* clientId, const std::string& ivec)
{
std::vector<RipeByte> iv;
Expand Down
32 changes: 28 additions & 4 deletions deps/ripe/Ripe.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//
// Ripe
//
// Copyright 2017-present Muflihun Labs
// Copyright 2017-present Zuhd Web Services
//
// https://muflihun.com/
// https://muflihun.github.io/ripe/
// https://github.com/muflihun/ripe
// https://muflihun.com
// https://zuhd.org
// https://github.com/zuhd-org/ripe
//
// Author: @abumusamq
//
Expand Down Expand Up @@ -390,6 +390,30 @@ RIPE_API class Ripe {
*/
static std::string decompressString(const std::string& str);

/*****************************************************************************************************/

/*******************************************************************\
* MISC *
*******************************************************************
*******************************************************************
* *
* SHA *
* *
*******************************************************************
*******************************************************************
\*******************************************************************/

/**
* @brief Generate SHA-256 hash of given string
*/
static std::string sha256Hash(const std::string&);


/**
* @brief Generate SHA-512 hash of given string
*/
static std::string sha512Hash(const std::string&);


/*****************************************************************************************************/

Expand Down
10 changes: 5 additions & 5 deletions dist/npm/headers/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "libresidue",
"version": "2.1.3",
"description": "Residue C++ client library (headers only). For binaries please go to https://github.com/muflihun/residue-cpp/releases",
"version": "2.1.4",
"description": "Residue C++ client library (headers only). For binaries please go to https://github.com/zuhd-org/residue-cpp/releases",
"main": "include_dirs.js",
"homepage": "https://github.com/muflihun/residue-cpp",
"author": "Muflihun Labs <[email protected]>",
"homepage": "https://github.com/zuhd-org/residue-cpp",
"author": "Zuhd Web Services <[email protected]>",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "http://github.com/muflihun/residue-cpp.git"
"url": "http://github.com/zuhd-org/residue-cpp.git"
},
"keywords": [
"residue",
Expand Down
Loading

0 comments on commit 65bd24d

Please sign in to comment.