Coder Social home page Coder Social logo

rikyoz / qtcryptohash Goto Github PK

View Code? Open in Web Editor NEW
15.0 5.0 1.0 105 KB

A lightweight Qt C++ library providing some of the cryptographic hash algorithms not supported by QCryptographicHash

License: GNU General Public License v2.0

QMake 1.48% C++ 96.87% Python 1.65%
cryptographic-hashes hash hashing tiger ripemd160 whirlpool cpp c-plus-plus qt qt5

qtcryptohash's Introduction

QtCryptoHash Build Status

QtCryptoHash is a Qt C++ library providing a way to calculate some of the cryptographic hashes not supported by the QCryptographicHash class from the Qt library.

Features

  • Supports Tiger-192, RipeMD-160 and Whirlpool algorithms
  • Simple interface, identical to the QCryptographicHash class, but renamed QCryptoHash
  • Works with Qt 5.x
  • Supports MSVC, MinGW, GCC and Clang

Basic Usage

String Hash Calculation

#include "qcryptohash.hpp"
...
QByteArray stringHash = QCryptoHash::hash( "abc", QCryptoHash::TIGER );
qInfo() << stringHash.toHex(); //f258c1e88414ab2a527ab541ffc5b8bf935f7b951c132951

File Hash Calculation

#include "qcryptohash.hpp"
...
QFile file( filename );
if ( file.open( QFile::ReadOnly ) ) {
	QCryptoHash ripemdHash( QCryptoHash::RMD160 );
	while( !file.atEnd() ){
		ripemdHash.addData( file.read( 8192 ) );
	}
	QByteArray fileHash = ripemdHash.result();	
	qInfo() << fileHash.toHex(); //RipeMD hash of 'filename' file content
}

For a complete description of the QCryptoHash API, see the relative wiki.

Dependencies

QtCryptoHash needs only QtCore library to be linked to the program.

Building

A complete guide to build this library is available here.

License (GPL v2)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

qtcryptohash's People

Contributors

rikyoz avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

qtcryptohash's Issues

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.