Skip to content

Commit

Permalink
Merge branch 'release/v0.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Nov 27, 2015
2 parents ba39b74 + 31948c3 commit 34c742a
Show file tree
Hide file tree
Showing 47 changed files with 2,195 additions and 3,028 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ bin/
lib/boost/
*.pro.user*
*.cppcheck
*.autosave
lib/qtcryptohash/
*.7z
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
Expand Down
46 changes: 36 additions & 10 deletions MrHash.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ TEMPLATE = app

contains(QT_ARCH, i386) {
PLATFORM = x86
TARGET = mrhash
} else {
PLATFORM = x64
TARGET = mrhash64
ARCH_SUFFIX = 64
}

TARGET = mrhash$${ARCH_SUFFIX}

VPATH += ./src/ \
./include/ \
./lib/ \
Expand All @@ -25,15 +26,38 @@ VPATH += ./src/ \
INCLUDEPATH += ./include/ \
./lib/

SOURCES += main.cpp mainwindow.cpp about.cpp \
globalstuff.cpp tiger.cpp rmd160.cpp haval.cpp \
qhasher.cpp fileinfowidget.cpp filehashcalculator.cpp
SOURCES += \
src/main.cpp \
src/mainwindow.cpp \
src/about.cpp \
src/globalstuff.cpp \
src/haval.cpp \
src/qextrahash.cpp \
src/fileinfowidget.cpp \
src/filehashcalculator.cpp \
src/util.cpp \
src/crc.cpp \
src/fileiconwidget.cpp \
src/base64dialog.cpp \
src/filebase64calculator.cpp


HEADERS += mainwindow.hpp about.hpp \
bithelp.h globalstuff.h tiger.h rmd160.h haval.h err.h \
qhasher.hpp fileinfowidget.hpp filehashcalculator.hpp
HEADERS += \
include/mainwindow.hpp \
include/about.hpp \
include/haval.hpp \
include/qextrahash.hpp \
include/hashalgorithm.hpp \
include/fileinfowidget.hpp \
include/filehashcalculator.hpp \
include/globalstuff.hpp \
include/util.hpp \
include/crc.hpp \
include/fileiconwidget.hpp \
include/base64dialog.hpp \
include/filebase64calculator.hpp

FORMS += mainwindow.ui about.ui fileinfowidget.ui
FORMS += mainwindow.ui about.ui fileinfowidget.ui fileiconwidget.ui base64dialog.ui

RESOURCES += res/icon.qrc res/translations.qrc

Expand All @@ -54,10 +78,12 @@ UI_DIR = ./$${BUILD}/.ui

MAJOR_VER = 0
MINOR_VER = 3
PATCH_VER = 0
PATCH_VER = 1
VERSION = $${MAJOR_VER}.$${MINOR_VER}.$${PATCH_VER}
DEFINES += "MAJOR_VER=$${MAJOR_VER}" "MINOR_VER=$${MINOR_VER}" "PATCH_VER=$${PATCH_VER}"

LIBS += -L$$PWD/lib/qtcryptohash/bin/$${PLATFORM}/$${BUILD}/ -lQtCryptoHash$${ARCH_SUFFIX}
DEFINES += QTCRYPTOHASH_STATIC
######################## OS DEPENDENT OPTIONS ########################
win32 {
# CONTENT OF THE RC FILE #
Expand Down
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# Mr. Hash
Mr. Hash is a cross-platform tool for calculating the hashes of files and plain texts.
# Mr. Hash [![Build Status](https://ci.appveyor.com/api/projects/status/t7q9r8489kdkpfnr?svg=true&passingText=Build%20OK&pendingText=Building...&failingText=Build%20Failed")](https://ci.appveyor.com/project/rikyoz/mrhash)<img src="/res/icon.png" width="40px" height="40px" align="right" />

[![Build status](https://ci.appveyor.com/api/projects/status/t7q9r8489kdkpfnr?svg=true&passingText=build%20OK%20&pendingText=building...%20&failingText=build%20failed%20)](https://ci.appveyor.com/project/rikyoz/mrhash) ![](http://img.shields.io/badge/version-v0.3.0-blue.svg?style=flat) ![](https://img.shields.io/badge/platform-windows%20|%20linux%20|%20mac-red.svg?style=flat) ![](http://img.shields.io/badge/architecture-x86%20|%20x64-yellow.svg?style=flat) ![](http://img.shields.io/badge/license-GPL%20v2-lightgrey.svg?style=flat)
**Mr. Hash** is a cross-platform tool for calculating the hashes of files and plain texts.

[![](http://img.shields.io/badge/version-v0.3.1-blue.png?style=flat)](https://github.com/rikyoz/mrhash/releases/latest)
![](https://img.shields.io/badge/platform-Windows%20|%20Linux%20|%20Mac%20OS%20X-red.png?style=flat)
![](http://img.shields.io/badge/architecture-x86%20|%20x64-yellow.png?style=flat)
[![](http://img.shields.io/badge/license-GNU%20GPL%20v2-lightgrey.png?style=flat)](/LICENSE)

## Features
+ Supports hashing of **files** and **plain text**
+ Calculates the most used **hashing algorithms**, such as **MD5**, **SHA1** and [**many others**](#supported-algorithms)
+ Supports **CRC16**, **CRC32** and **CRC64** checksum algorithms
+ Simple and easy-to-use GUI
+ Cross platform: it runs on **Windows**, **Linux** and **Mac OS X**

## Screenshots
![](/doc/img/screenshot0-v0.3.png)
![](/doc/img/screenshot1-v0.3.png)
<p align="center">
<img src="https://raw.github.com/rikyoz/mrhash/screenshots/doc/img/v0.3.1/screenshot0.png" /><br/>
<img src="https://raw.github.com/rikyoz/mrhash/screenshots/doc/img/v0.3.1/screenshot1.png" />
</p>

## Supported Algorithms
+ MD4
Expand All @@ -14,12 +27,23 @@ Mr. Hash is a cross-platform tool for calculating the hashes of files and plain
+ SHA-224, SHA-256, SHA-384, SHA-512
+ SHA3-224, SHA3-256, SHA3-384, SHA3-512
+ Tiger
+ HAVAL
+ RIPEMD
+ HAVAL-128, HAVAL-160, HAVAL-192, HAVAL-224, HAVAL-256
+ RIPEMD-160
+ CRC16
+ CRC32
+ CRC64

<p align="center">
<img src="/res/icon.png" />
</p>
## 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.
34 changes: 22 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,56 @@
version: 0.3.0-build{build}
version: 0.3.1-build{build}
skip_non_tags: true
os: Windows Server 2012 R2
shallow_clone: true

branches:
only:
- master
- develop

configuration:
- release

environment:
mrhash_version: 0.3.0
mrhash_version: 0.3.1
qt_version: 5.5
boost_dir: C:\Libraries\boost_1_59_0
msvc_dir: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC

matrix:
#MSVC x86
- name: win32
platform: x86
arch: x86
target: mrhash.exe
qt_dir: C:\Qt\%qt_version%\msvc2013\bin

#MSVC x64
- name: win64
platform: x64
arch: x64
target: mrhash64.exe
qt_dir: C:\Qt\%qt_version%\msvc2013_64\bin

init:
- set PATH=%PATH%;%msvc_dir%;%qt_dir%;
- vcvarsall.bat %platform%

build_script:
- set PATH=%PATH%;%msvc_dir%;%qt_dir%
- vcvarsall.bat %arch%
install:
- mkdir lib
- mklink /j lib\boost %boost_dir%\boost
- cd lib
- mkdir qtcryptohash
- appveyor DownloadFile https://github.com/rikyoz/QtCryptoHash/releases/download/v0.1.0/QtCryptoHash-v0.1.0-msvc2013-win32-static.7z -FileName qtcryptohash-static.7z
- 7z x qtcryptohash-static.7z -oqtcryptohash/ -aoa
- appveyor DownloadFile https://github.com/rikyoz/QtCryptoHash/releases/download/v0.1.0/QtCryptoHash-v0.1.0-msvc2013-win64-static.7z -FileName qtcryptohash64-static.7z
- 7z x qtcryptohash64-static.7z -oqtcryptohash/ -aoa
- cd ..

build_script:
- mkdir build
- cd build
- qmake ..\MrHash.pro
- qmake ..\MrHash.pro "CONFIG += release"
- nmake release
- cd ..\bin\%platform%\release
- cd ..\bin\%arch%\release
- windeployqt %target% --release --no-translations --no-svg --no-angle --no-system-d3d-compiler --no-quick-import
- 7z a -t7z mrhash-v%mrhash_version%-bin-%name%.7z *

Expand All @@ -52,8 +62,8 @@ test: off

deploy:
provider: GitHub
release: Mr. Hash v%mrhash_version%
description: ''
release: $(APPVEYOR_REPO_TAG_NAME)
description: 'Binaries of Mr. Hash v%mrhash_version%'
auth_token:
secure: 4V5xJQT+iVPUhK05TBLkNkLY8HTArZ+omH394hfXqQuxfrkaQqnR8132rDnB/HVm
artifact: /.*\.7z/
Expand Down
Binary file removed doc/img/screenshot.png
Binary file not shown.
Binary file removed doc/img/screenshot0-v0.3.png
Binary file not shown.
Binary file removed doc/img/screenshot1-v0.3.png
Binary file not shown.
28 changes: 28 additions & 0 deletions include/base64dialog.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef BASE64DIALOG_HPP
#define BASE64DIALOG_HPP

#include <memory>

#include "ui_base64dialog.h"

#include "filebase64calculator.hpp"

class Base64Dialog : public QDialog, private Ui::Base64Dialog {
Q_OBJECT

public:
explicit Base64Dialog( QString fileName, QWidget* parent = 0 );
virtual ~Base64Dialog();

private slots:
void on_complete( QByteArray base64 );

private:
QString m_filename;
std::unique_ptr< FileBase64Calculator > m_base64calculator;

protected:
void closeEvent( QCloseEvent* event ) Q_DECL_OVERRIDE;
};

#endif // BASE64DIALOG_HPP
55 changes: 0 additions & 55 deletions include/bithelp.h

This file was deleted.

25 changes: 25 additions & 0 deletions include/crc.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef HASHER_H
#define HASHER_H

#include <QString>

#include "boost/crc.hpp"

using boost::crc_optimal;
using boost::crc_ccitt_type;

// CRC16-CCITT (X.25) - the same used by qChecksum
typedef crc_optimal< 16, 0x1021, 0xffff, 0xffff, true, true > boost_crc16;

// CRC-32 (PKZIP) - http://reveng.sourceforge.net/crc-catalogue/17plus.htm#crc.cat-bits.32
typedef crc_optimal< 32, 0x04c11db7, 0xffffffff, 0xffffffff, true, true > boost_crc32;

// CRC-64 (XZ) - http://reveng.sourceforge.net/crc-catalogue/17plus.htm#crc.cat-bits.64
typedef crc_optimal< 64, 0x42f0e1eba9ea3693, 0xffffffffffffffff, 0xffffffffffffffff, true, true > boost_crc64;

struct QChecksum {
enum Algorithm { CRC16, CRC32, CRC64 };
static quint64 checksum( const QByteArray msg , Algorithm algorithm );
};

#endif // HASHER_H
Loading

0 comments on commit 34c742a

Please sign in to comment.