qcalcfilehash_1.0.7+git20200816.1eb8770/0000755000000000000000000000000013716360136015472 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/README.md0000644000000000000000000000205413716360136016752 0ustar rootroot# README # Calculator hash (SHA1, SHA-224, SHA-256, SHA-384, SHA-512, MD5, CRC32, CRC8) This program is licensed under the terms and conditions of the GNU General Public License (GPLv3+); either version 3 of the License, or (at your option) any later version. Please read the 'COPYING' file for more information. Please note the "with the OpenSSL exception" The utility has the same console interface. Type qcalcfilehash --help, for reference. ![QCalcFileHash images](http://dansoft.krasnokamensk.ru/data/1018/qcalcfilehash.png) ### How do I get set up? ### qmake lupdate ./QCalcFileHash.pro lrelease ./QCalcFileHash.pro mkdir /usr/share/qcalcfilehash/ cp *.qm /usr/share/qcalcfilehash/ make ### Who do I talk to? ### email: dik@inbox.ru ### Copyright ### Copyright 2017-2020 DanSoft This program is licensed under the terms and conditions of the GNU General Public License (GPLv3+); either version 3 of the License, or (at your option) any later version with the OpenSSL exception. Please read the 'COPYING' file for more information. qcalcfilehash_1.0.7+git20200816.1eb8770/manpages/0000755000000000000000000000000013716360136017265 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/manpages/qcalcfilehash.10000644000000000000000000000234313716360136022140 0ustar rootroot.\" Text automatically generated by txt2man .TH qcalcfilehash 1 "12 Aug 2020" "qcalcfilehash-1.0.7" "graphical utility for computing hash sums" .SH NAME \fBQCalcFileHash \fP- graphical utility for computing hash sums .SH SYNOPSIS .nf .fam C \fBqcalcfilehash\fP [\fIoptions\fP] \fIfilename\fP \fIhash\fP .fam T .fi .fam T .fi .SH DESCRIPTION QCalcFileHash is a graphical utility for calculation and verification of a wide range of \fIhash\fP sums like SHA1, SHA-224, SHA-256, SHA-384, SHA-512, MD5, CRC32, CRC8. .PP It can be used on command line as well. .SH OPTIONS .TP .B \fB-h\fP, \fB--help\fP Displays help on commandline \fIoptions\fP. .TP .B \fB--help-all\fP Displays help including Qt specific \fIoptions\fP. .TP .B \fB-v\fP, \fB--version\fP Displays version information. .TP .B \fB--compare\fP <\fIhash\fP> \fIhash\fP comparison .TP .B \fB-p\fP Show progress .TP .B \fB-l\fP, \fB--list\fP Show list all \fIhash\fP algorithm .SH ARGUMENTS .TP .B \fIfilename\fP Source file to \fIhash\fP .TP .B \fIhash\fP Hash algorithm .SH AUTHOR QCalcFileHash was written by DanSoft . All rights reserved. .PP This manual page was written by Fabio Augusto De Muzio Tobich for the Debian project (but may be used by others). qcalcfilehash_1.0.7+git20200816.1eb8770/COPYING0000644000000000000000000010451313716360136016531 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . qcalcfilehash_1.0.7+git20200816.1eb8770/ObjectConsole.cpp0000644000000000000000000000540713716360136020735 0ustar rootroot#include "ObjectConsole.h" #include "ThreadCalcHash.h" #include #include #include ObjectConsole::ObjectConsole(QObject *parent) : QObject(parent){ current_progress=0; } void ObjectConsole::calcHash(QStringList listPositionalArguments,bool showProgress,bool showlistOption,QString compareHash){ if (showlistOption){ std::cout << "CRC-8, CRC-32, MD4, MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512" << std::endl; exit(0); } if (listPositionalArguments.size()!=2){ qCritical("%s",qUtf8Printable(tr("Invalid positional arguments"))); exit(0); } QString filename = listPositionalArguments.at(0); QString hashAlgorithm = listPositionalArguments.at(1); HASH_ALGORITHM hash = HASH_ALGORITHM::Crc8; _showProgress=showProgress; _compareHash=compareHash; if (hashAlgorithm=="CRC-8"){ hash=HASH_ALGORITHM::Crc8; }else if (hashAlgorithm=="CRC-32"){ hash=HASH_ALGORITHM::Crc32; }else if (hashAlgorithm=="MD4"){ hash=HASH_ALGORITHM::Md4; }else if (hashAlgorithm=="MD5"){ hash=HASH_ALGORITHM::Md5; }else if (hashAlgorithm=="SHA-1"){ hash=HASH_ALGORITHM::Sha1; }else if (hashAlgorithm=="SHA-224"){ hash=HASH_ALGORITHM::Sha224; }else if (hashAlgorithm=="SHA-256"){ hash=HASH_ALGORITHM::Sha256; }else if (hashAlgorithm=="SHA-384"){ hash=HASH_ALGORITHM::Sha384; }else if (hashAlgorithm=="SHA-512"){ hash=HASH_ALGORITHM::Sha512; }else{ qCritical("%s",qUtf8Printable(tr("Invalid hash argument"))); exit(0); } qInfo(qUtf8Printable(tr("Filename: %s")),qUtf8Printable(filename)); ThreadCalcHash *thCaclHash = new ThreadCalcHash(); thCaclHash->setFilename(filename); thCaclHash->setHashAlgorithm(hash); if (showProgress){ connect(thCaclHash,SIGNAL(changeValue(int)),this,SLOT(calcHashChangeValue(int))); } connect(thCaclHash,SIGNAL(result(QString)),this,SLOT(calcHashResult(QString))); thCaclHash->start(); } void ObjectConsole::calcHashChangeValue(int value){ int proc = value/10; std::cout << "\033[0G"; std::cout << "Calc: ["; for (int i=0;i #include #include #include #include #include "mainwindow.h" #include "ObjectConsole.h" #include "version.h" #include int main(int argc, char *argv[]){ #ifdef Q_OS_LINUX bool useGUI = getenv("DISPLAY") != NULL; #else bool useGUI = true; #endif QTranslator translator; QTranslator qtTranslator; QString locale = QLocale::system().name(); qtTranslator.load("qt_"+locale,QLibraryInfo::location(QLibraryInfo::TranslationsPath)); if (translator.load(QString("qcalcfilehash_") + locale)==false){ translator.load(QString("/usr/share/qcalcfilehash/langs/qcalcfilehash_") + locale); } bool showProgress=false; bool showlistOption=false; bool isForceGui=false; QStringList listPositionalArguments; QString compareHash=""; { QCoreApplication app(argc, argv); QCoreApplication::setApplicationName("QCalcFileHash"); QCoreApplication::setApplicationVersion(VERSION); QCoreApplication::setOrganizationDomain("dansoft.krasnokamensk.ru"); app.installTranslator(&qtTranslator); app.installTranslator(&translator); QCommandLineParser parser; parser.setApplicationDescription("Calculator hash (SHA1, SHA-224, SHA-256, SHA-384, SHA-512, MD5, CRC32, CRC8)"); parser.addHelpOption(); parser.addVersionOption(); parser.addPositionalArgument("filename", QCoreApplication::tr("Source file to hash")); parser.addPositionalArgument("hash", QCoreApplication::tr("Hash algorithm")); QCommandLineOption CompareHash(QStringList() << "compare", QCoreApplication::tr("hash comparison"), QCoreApplication::tr("hash")); parser.addOption(CompareHash); QCommandLineOption showProgressOption("p", QCoreApplication::tr("Show progress")); parser.addOption(showProgressOption); QCommandLineOption listOption(QStringList() << "l" << "list", QCoreApplication::tr("Show list all hash algorithm")); parser.addOption(listOption); QCommandLineOption forceGui(QStringList() << "gui", QCoreApplication::tr("Open in gui")); parser.addOption(forceGui); parser.process(app); listPositionalArguments = parser.positionalArguments(); showProgress = parser.isSet(showProgressOption); showlistOption = parser.isSet(listOption); compareHash = parser.value(CompareHash); isForceGui = parser.isSet(forceGui); } if (listPositionalArguments.size()!=0 or showlistOption!=false){ useGUI=false; } if (isForceGui) useGUI=true; if (useGUI){ QApplication app(argc, argv); app.installTranslator(&qtTranslator); app.installTranslator(&translator); MainWindow form; if (listPositionalArguments.size()>=1) form.setFilename(listPositionalArguments.at(0)); if (listPositionalArguments.size()>=2) form.setHash(listPositionalArguments.at(1)); form.show(); form.startCalc(); return app.exec(); }else{ QCoreApplication app(argc, argv); app.installTranslator(&qtTranslator); app.installTranslator(&translator); ObjectConsole form; form.calcHash(listPositionalArguments,showProgress,showlistOption,compareHash); return app.exec(); } } qcalcfilehash_1.0.7+git20200816.1eb8770/ThreadCalcHash.h0000644000000000000000000000234713716360136020447 0ustar rootroot#ifndef THREADCALCHASH_H #define THREADCALCHASH_H #include enum class HASH_ALGORITHM : int { Crc8, Crc32, Md4, Md5, Sha1, Sha224, Sha256, Sha384, Sha512, }; class ThreadCalcHash : public QThread { Q_OBJECT public: ThreadCalcHash(); ~ThreadCalcHash(); void run(); void setFilename(QString filename); void setHashAlgorithm(HASH_ALGORITHM algorithm); private: QString _filename; HASH_ALGORITHM _hashAlgorithm; std::string getCrc8FromFile(const std::string &filename); std::string getCrc32FromFile(const std::string &filename); std::string getMD4FromFile(const std::string &filename); std::string getMD5FromFile(const std::string &filename); std::string getSHA1FromFile(const std::string &filename); std::string getSHA224FromFile(const std::string &filename); std::string getSHA256FromFile(const std::string &filename); std::string getSHA384FromFile(const std::string &filename); std::string getSHA512FromFile(const std::string &filename); private slots: signals: void changeValue(int); void result(QString); }; #endif // THREADCALCHASH_H qcalcfilehash_1.0.7+git20200816.1eb8770/.gear/0000755000000000000000000000000013716360136016466 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/.gear/qcalcfilehash.spec0000644000000000000000000000171013716360136022130 0ustar rootrootSummary: Hash calculator Name: qcalcfilehash Version: 1.0.7 Release: alt1 License: GPLv3+ Group: File tools Url: https://bitbucket.org/admsasha/qcalcfilehash Source0: %{name}-%{version}.tar BuildRequires: qt5-tools BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Widgets) %description Hash calculator (SHA1, SHA-224, SHA-256, SHA-384, SHA-512, MD5, CRC32, CRC8). %prep %setup -q %build %qmake_qt5 %make_build %install %makeinstall INSTALL_ROOT=%{buildroot} %files %doc README.md %{_bindir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/%{name}/ %{_iconsdir}/hicolor/*/apps/%{name}.png %changelog * Wed Aug 12 2020 Alexander Danilov 1.0.7-alt1 - release 1.0.7 * Thu Aug 19 2019 Alexander Danilov 1.0.6-alt1 - release 1.0.6 * Fri Aug 2 2019 Alexander Danilov 1.0.5-alt1 - release 1.0.5 qcalcfilehash_1.0.7+git20200816.1eb8770/.gear/rules0000644000000000000000000000007413716360136017544 0ustar rootroottar: . name=@name@-@version@ spec: .gear/qcalcfilehash.spec qcalcfilehash_1.0.7+git20200816.1eb8770/mainwindow.ui0000644000000000000000000001474613716360136020221 0ustar rootroot MainWindow 0 0 540 310 MainWindow 11 Path: Open 11 true Algorithm: 200 16777215 Qt::Horizontal 180 20 true <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html> false Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse 24 Qt::AlignCenter QProgressBar::TopToBottom Calc true Check: TextLabel FreeSans 8 Copyright 2017-2020 DanSoft. All rights reserved. Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft Qt::Horizontal 140 20 Compare the hash true Close Qt::Horizontal 40 20 400 16777215 QFrame::Box TextLabel Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse qcalcfilehash_1.0.7+git20200816.1eb8770/.gitignore0000644000000000000000000000020713716360136017461 0ustar rootroot/.build/ /Bin/ /0000/ /release/ /debug/ /Makefile /Makefile.Debug /Makefile.Release /QCalcFileHash.pro.user /.qmake.stash /langs/*.qm qcalcfilehash_1.0.7+git20200816.1eb8770/pkg/0000755000000000000000000000000013716360136016253 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/pkg/qcalcfilehash.spec0000644000000000000000000000147413716360136021724 0ustar rootrootSummary: Hash calculator Name: qcalcfilehash Version: 1.0.7 Release: 1 License: GPLv3+ Group: File tools Url: https://bitbucket.org/admsasha/qcalcfilehash Source0: https://bitbucket.org/admsasha/QCalcFileHash/downloads/%{name}-%{version}.tar.gz BuildRequires: qt5-linguist-tools BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Widgets) %description Hash calculator (SHA1, SHA-224, SHA-256, SHA-384, SHA-512, MD5, CRC32, CRC8). %files %doc README.md %{_bindir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/%{name}/ %{_iconsdir}/hicolor/*/apps/%{name}.png #---------------------------------------------------------------------------- %prep %setup -q %build %qmake_qt5 %make %install %make_install INSTALL_ROOT=%{buildroot} qcalcfilehash_1.0.7+git20200816.1eb8770/pkg/qcalcfilehash.desktop0000644000000000000000000000065613716360136022444 0ustar rootroot[Desktop Entry] Name=QCalcFileHash Comment=Calculator hash (SHA1, SHA-224, SHA-256, SHA-384, SHA-512, MD5, CRC32, CRC8) Comment[pt_BR]=Calculadora de hash (SHA1, SHA-224, SHA-256, SHA-384, SHA-512, MD5, CRC32, CRC8) GenericName=Hash calculator GenericName[pt_BR]=Calculadora de hash Type=Application Exec=qcalcfilehash Icon=qcalcfilehash Categories=System;FileTools; Keywords=Hash;SHA1;SHA224;SHA256;SHA384;SHA512;MD5;CRC32;CRC8; qcalcfilehash_1.0.7+git20200816.1eb8770/pkg/ServiceMenus/0000755000000000000000000000000013716360136020663 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/pkg/ServiceMenus/qcalcfilehash.desktop0000644000000000000000000000312713716360136025050 0ustar rootroot[Desktop Entry] Type=Service X-KDE-ServiceTypes=KonqPopupMenu/Plugin MimeType=all/allfiles; Actions=calculateCRC8;calculateCRC32;calculateMD4;calculateMD5;calculateSHA1;calculateSHA224;calculateSHA256;calculateSHA384;calculateSHA512; X-KDE-Submenu=Hash calculator X-KDE-Submenu[ru]=аšаАаЛбŒаКбƒаЛбб‚аОб€ б…аЕбˆ ббƒаМаМ Icon=qcalcfilehash [Desktop Action calculateCRC8] Name=Calculate CRC-8 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ CRC-8 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f CRC-8 [Desktop Action calculateCRC32] Name=Calculate CRC-32 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ CRC-32 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f CRC-32 [Desktop Action calculateMD4] Name=Calculate MD4 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ MD4 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f MD4 [Desktop Action calculateMD5] Name=Calculate MD5 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ MD5 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f MD5 [Desktop Action calculateSHA1] Name=Calculate SHA-1 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ SHA-1 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f SHA-1 [Desktop Action calculateSHA224] Name=Calculate SHA-224 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ SHA-224 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f SHA-224 [Desktop Action calculateSHA256] Name=Calculate SHA-256 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ SHA-256 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f SHA-256 [Desktop Action calculateSHA384] Name=Calculate SHA-384 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ SHA-384 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f SHA-384 [Desktop Action calculateSHA512] Name=Calculate SHA-512 Name[ru]=аŸаОбб‡аИб‚аАб‚бŒ SHA-512 Icon=qcalcfilehash Exec=qcalcfilehash --gui %f SHA-512 qcalcfilehash_1.0.7+git20200816.1eb8770/pkg/icons/0000755000000000000000000000000013716360136017366 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/pkg/icons/48x48/0000755000000000000000000000000013716360136020165 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/pkg/icons/48x48/qcalcfilehash.png0000644000000000000000000000331313716360136023462 0ustar rootroot‰PNG  IHDR00`м ЕsRGBЎЮщgAMAБ ќaPLTE3fЬ5hЭ;lЮ>oЯ@pЯAqаCrаDsаGuбHvбJwвJxвLyвNzгP|гQ|дS~дT~дTеU€еY‚еX‚ж[„ж\…з_‡з`‡з`ˆзaˆиbŠиdŠиfŒиeŒйiŽйiŽкkкlкl‘лm’кn’лo”лp”лq•мs–мt—мt—нv˜нwšнxšнz›о{œо}žо~žп€Ÿп‚Ёр‚Ђр„Ђр…Ѓс†ЄсˆЅсˆІс‰ІтŒЉтŽЊтŽЊуЌу‘­ф“Ўф”Џф–Ах˜Бх˜Вх˜Вц›ДцœДцЕчžЖчЁЙч ИшЃКшЄКшІМщЊПщЊПъЌСъ­ТъЏУыЏФыАУыБФыБФьВЦьДЧьДЧэЖШэИЩэИЪэЙЫюКЬюМЭюНЭяОЮюПЯяСаяСб№Тв№Фг№ФгёЦдёЧжђШеёШжёЩжђЬиђЮкђЮкѓамѓвоєдпєепѕжрѕйтѕйтінхінхїнціоцїрчїсшїсщјуъјфыјфыљцьјхьљщюљщюњы№њьёњюђћёєћёєќѓіќєіќєї§іј§јљ§јњ§љћўћќўќ§ў§§џўўџ№rшљ pHYsУУЧoЈdTIDATHKэ”љ[г0Ч‹ї17ч†'Xъ9Ќ8Ћр€IЌЬql(р‡NаЉD`J2(c”фп5MКИ=њx§ьї—МЩѓ~š7IП/‡ўRџ?&&Вdv/ЌхIPЁO‘xЪm и5ДAfЭ­Љ *Да6˜ДCDХ 3MTђrмЖtK’2ƒЩ‰ д†‹„МП'тящл8…ВfXra ш”DЁQжwВ$ž—"ПшыnnЯ>0H hЩW^ )рї*Е•ZЗcђЛœрЎХPНчАУRПЩБ`Ђq‰‹ѕ9Ф!Д§Аоыt{jм\џpПѓ€чhm›žќнU7­]я\^Kњ^hoЭ@щ<куйХРш,BzДGХ)а>fvЌЅ–*dцчs™EУDi Ўр­IŒL]ЗЪ @>OѓQЮњЙwЖЭ*цŠ˜Э›y<Я ж@€ПбПYэNГЧУwЬ­к –*МFUВKПШзд СЉ‚Н„Uс5Њ Eœ zїљьГTс5ЊайвЃm˜йЕ%Џ№$ЫLG}МЃ…•JЂyIŒ[Ѓhv)eІ#oЌ%WXЉ0uаПзЮLЗ€Я{Ћ••Jcюˆј=п`ІЛЯЫъжЉњйU}щfЈ€Ž2 УL7ФЫQнй`‹І:MЫ.‡™ќ-{™Јthї™'Д[N„C™Ž[x}>•&5P!ЁF^С{2m}*3F—жСЭМ9xŸЖна ЯОZВ”™qtв-i†~а.Z>G=Ю“’Žмž45fК^ ОqШхr] —Ёэ”,д‰b˜|2Ьt1ЫkЉЈOЈaHKжLTQЂфљ˜щвФkxšbЯZ˜УШаѕ’щ дk;л9іJeРŸщ?№{!є ЯWC/b§њЧЄЂГl8}Її&`8m Тпёујуќ—“Yg%tEXtdate:create2017-08-29T18:34:23+10:00ю"#%tEXtdate:modify2017-08-04T11:07:42+10:00?иIENDЎB`‚qcalcfilehash_1.0.7+git20200816.1eb8770/pkg/icons/16x16/0000755000000000000000000000000013716360136020153 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/pkg/icons/16x16/qcalcfilehash.png0000644000000000000000000000101213716360136023442 0ustar rootroot‰PNG  IHDR‘h6sRGBЎЮщgAMAБ ќa pHYsУУЧoЈdŸIDAT8Ocќџџ?)€ J @žП§љіуo уюгяпў‹Ѓ€ЫїОBY gn}y№тБїм‡_ўй›П2€m;љhФЊЏ\јQuв‚/>8pёУЯпџ7{ЫХЦ4}уГЮхПџј{сЮ—ЧЏ~ВГ2іЎzŒар.QЏр /№ыїПЗŸ~ŸНѕхзŸЮЦ‚ЛЮМЊVрАдццcEh€ j bffјљыџЎгя Tx p жo?ўќљѓШјєэ|џљ7Pфгз??~§{ѓёHќ+H" в—ю~™Йщ„ђС P'}vсюO Ё;^М|џPkНЪОќВа˜n_њЈ(L@60 fm~І%ЯuъЦчŸПџщ*qsБ3ЙљЅ,RЈj+#а< іїž}ƒPфЪ§Џn&BЙAв`…АP АiYќшŒ™›Ÿ•С (eЃУ_;яAзђЧ§OчЬOРА!  "ДN­ ТWe.ќIENDЎB`‚qcalcfilehash_1.0.7+git20200816.1eb8770/ObjectConsole.h0000644000000000000000000000107013716360136020372 0ustar rootroot#ifndef OBJECTCONSOLE_H #define OBJECTCONSOLE_H #include class ObjectConsole : public QObject{ Q_OBJECT public: explicit ObjectConsole(QObject *parent = nullptr); void calcHash(QStringList listPositionalArguments, bool showProgress, bool showlistOption, QString compareHash); private: int current_progress; bool _showProgress; QString _compareHash; signals: private slots: void calcHashChangeValue(int value); void calcHashResult(QString hash); }; #endif // OBJECTCONSOLE_H qcalcfilehash_1.0.7+git20200816.1eb8770/version.h0000644000000000000000000000016213716360136017327 0ustar rootroot#ifndef VERSION_H #define VERSION_H #define VERSION "1.0.7" #define DATE_BUILD "12.08.2020" #endif // VERSION_H qcalcfilehash_1.0.7+git20200816.1eb8770/mainwindow.cpp0000644000000000000000000001022113716360136020346 0ustar rootroot#include "mainwindow.h" #include "ui_mainwindow.h" #include #include #include #include #include #include #include "ThreadCalcHash.h" #include "version.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->setWindowTitle("QCalcFileHash v"+QString(VERSION)+" ("+QString(DATE_BUILD)+")"); changeShowCompareForm(); ui->label_6->setText(""); ui->label_4->setText(tr("Copyright 2017-2020 DanSoft.")+tr("All rights reserved.")); connect(ui->pushButton,SIGNAL(clicked(bool)),this,SLOT(close())); connect(ui->pushButton_2,SIGNAL(clicked(bool)),this,SLOT(openfile())); connect(ui->pushButton_3,SIGNAL(clicked(bool)),this,SLOT(calcHash())); connect(ui->pushButton_4,SIGNAL(clicked(bool)),this,SLOT(changeShowCompareForm())); connect(ui->lineEdit,SIGNAL(textChanged(QString)),this,SLOT(resultCompare())); ui->comboBox->addItem("CRC-8",static_cast(HASH_ALGORITHM::Crc8)); ui->comboBox->addItem("CRC-32",static_cast(HASH_ALGORITHM::Crc32)); ui->comboBox->addItem("MD4",static_cast(HASH_ALGORITHM::Md4)); ui->comboBox->addItem("MD5",static_cast(HASH_ALGORITHM::Md5)); ui->comboBox->addItem("SHA-1",static_cast(HASH_ALGORITHM::Sha1)); ui->comboBox->addItem("SHA-224",static_cast(HASH_ALGORITHM::Sha224)); ui->comboBox->addItem("SHA-256",static_cast(HASH_ALGORITHM::Sha256)); ui->comboBox->addItem("SHA-384",static_cast(HASH_ALGORITHM::Sha384)); ui->comboBox->addItem("SHA-512",static_cast(HASH_ALGORITHM::Sha512)); ui->comboBox->setCurrentIndex(0); ui->label->setText(""); ui->progressBar->setValue(0); ui->progressBar->setEnabled(false); QTimer::singleShot(100,[&](){ // move to center this->move((qApp->primaryScreen()->size().width()-this->width())/2,(qApp->primaryScreen()->size().height()-this->height())/2); }); } MainWindow::~MainWindow() { delete ui; } void MainWindow::setFilename(QString filename){ ui->label->setText(filename); _filename=filename; } void MainWindow::setHash(QString hashName){ for (int i=0;icomboBox->count();i++){ if (ui->comboBox->itemText(i).toLower()==hashName.toLower()){ ui->comboBox->setCurrentIndex(i); return; } } } void MainWindow::startCalc(){ emit calcHash(); } void MainWindow::openfile(){ QString fileName = QFileDialog::getOpenFileName(this,tr("Open file"), "", tr("All Files (*)")); if (fileName.size() <= 0) return; ui->label->setText(fileName); _filename=fileName; } void MainWindow::calcHashChangeValue(int value) { ui->progressBar->setValue(value); } void MainWindow::calcHashResult(QString hash) { ui->textEdit->setText(hash); ui->progressBar->setValue(0); ui->progressBar->setEnabled(false); ui->pushButton_3->setEnabled(true); resultCompare(); } void MainWindow::changeShowCompareForm(){ if (ui->pushButton_4->isChecked()){ ui->label_6->setVisible(true); ui->label_5->setVisible(true); ui->lineEdit->setVisible(true); }else{ ui->label_6->setVisible(false); ui->label_5->setVisible(false); ui->lineEdit->setVisible(false); } } void MainWindow::calcHash(){ if (_filename.isEmpty()) return; ui->progressBar->setValue(0); ui->progressBar->setEnabled(true); ui->textEdit->setText(""); ui->pushButton_3->setEnabled(false); ThreadCalcHash *thCaclHash = new ThreadCalcHash(); thCaclHash->setFilename(_filename); thCaclHash->setHashAlgorithm(HASH_ALGORITHM(ui->comboBox->currentData().toInt())); connect(thCaclHash,SIGNAL(changeValue(int)),this,SLOT(calcHashChangeValue(int))); connect(thCaclHash,SIGNAL(result(QString)),this,SLOT(calcHashResult(QString))); thCaclHash->start(); } void MainWindow::resultCompare(){ if (ui->textEdit->toPlainText().toUpper()==ui->lineEdit->text().toUpper()){ ui->label_6->setText(""+tr("equally")+""); }else{ ui->label_6->setText(""+tr("different")+""); } } qcalcfilehash_1.0.7+git20200816.1eb8770/bitbucket-pipelines.yml0000644000000000000000000000240313716360136022156 0ustar rootroot# This is a sample build configuration for C++ яПН Make. # Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples. # Only use spaces to indent your .yml configuration. # ----- # You can specify a custom docker image from Docker Hub as your build environment. #image: gcc:6.1 #image: atlassian/default-image:2 image: smartapps/bitbucket-pipelines-debian-9 pipelines: default: - step: script: # Modify the commands below to build your repository. - apt-get update && apt-get install -y libc++-dev gcc cpp libgcc-6-dev dpkg-dev - apt-get install -y qt5-qmake qt5-default qttools5-dev qttools5-dev-tools - apt-get install -y libssl-dev libcurl4-openssl-dev - qmake - make - step: name: Deploy to test image: aneitayang/aws-cli:1.0 deployment: test script: - ls -la - pwd - echo "deploy to test" - step: name: Deploy to staging image: aneitayang/aws-cli:1.0 deployment: staging script: - echo "deploy to staging" - step: name: Deploy to production image: aneitayang/aws-cli:1.0 deployment: production script: - echo "deploy to production" qcalcfilehash_1.0.7+git20200816.1eb8770/mainwindow.h0000644000000000000000000000131113716360136020013 0ustar rootroot#ifndef MAINWINDOW_H #define MAINWINDOW_H #include namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); void setFilename(QString filename); void setHash(QString hashName); void startCalc(); private: Ui::MainWindow *ui; QString _filename; int oldValueProcHash; private slots: void calcHash(); void openfile(); void calcHashChangeValue(int value); void calcHashResult(QString hash); void changeShowCompareForm(); void resultCompare(); }; #endif // MAINWINDOW_H qcalcfilehash_1.0.7+git20200816.1eb8770/langs/0000755000000000000000000000000013716360136016576 5ustar rootrootqcalcfilehash_1.0.7+git20200816.1eb8770/langs/qcalcfilehash_ru.ts0000644000000000000000000001345513716360136022453 0ustar rootroot MainWindow Close а’б‹б…аОаД Open аžб‚аКб€б‹б‚бŒ Algorithm: ааЛаГаОб€аИб‚аМ: Calc аŸаОбб‡аИб‚аАб‚бŒ Path: аŸбƒб‚бŒ: Check: аŸб€аОаВаЕб€аКаА: Compare the hash аЁб€аАаВаНаЕаНаИаЕ б б…аЕбˆаЕаМ Copyright 2017-2020 DanSoft. Copyright 2017-2020 DanSoft. All rights reserved. а’баЕ аПб€аАаВаА аЗаАб‰аИб‰аЕаНб‹ Open file аžб‚аКб€б‹б‚бŒ б„аАаЙаЛ All Files (*) а’баЕ б„аАаЙаЛб‹ (*) equally аОаДаИаНаАаКаОаВб‹аЙ different б€аАаЗаНб‹аЙ All Files (*.*) а’баЕ б„аАаЙаЛб‹ (*.*) ObjectConsole Invalid positional arguments ааЕ аВаЕб€аНаО бƒаКаАаЗаАаНб‹ аАб€аГбƒаМаЕаНб‚б‹ Invalid hash argument аЃаКаАаЗаАаН аНаЕббƒб‰аЕбб‚аВбƒбŽб‰аИаЙ hash аАаЛаГаОб€аИб‚аМ Filename: %s а˜аМб б„аАаЙаЛаА: %s Result: а аЕаЗбƒаЛбŒб‚аАб‚: Check: %s аŸб€аОаВаЕб€аКаА: %s equally аОаДаИаНаАаКаОаВб‹аЙ different б€аАаЗаНб‹аЙ Result: %s а аЕаЗбƒаЛбŒб‚аАб‚: %s QCoreApplication Source file to hash Source file to hash. а˜бб…аОаДаНб‹аЙ б„аАаЙаЛ аДаЛб б…аЕбˆаИб€аОаВаАаНаИб Hash algorithm Hash algorithm. аЅаЕбˆ-аАаЛаГаОб€аИб‚аМ hash comparison аЅаЕбˆ аДаЛб бб€аАаВаНаЕаНаИб hash аЅаЕбˆ Show progress аŸаОаКаАаЗб‹аВаАб‚бŒ аПб€аОб†аЕбб Show list all hash algorithm Show list all hash algorithm. а’б‹аВаЕбб‚аИ аВбаЕ б…аЕбˆ-аАаЛаГаОб€аИб‚аМб‹ Open in gui аžб‚аКб€б‹б‚бŒ аВ GUI Result: а аЕаЗбƒаЛбŒб‚аАб‚: qcalcfilehash_1.0.7+git20200816.1eb8770/langs/qcalcfilehash_en.ts0000644000000000000000000001231313716360136022417 0ustar rootroot MainWindow Close Open Algorithm: Calc Path: Check: Compare the hash Copyright 2017-2020 DanSoft. All rights reserved. Open file All Files (*) equally different ObjectConsole Invalid positional arguments Invalid hash argument Filename: %s Result: %s Check: %s equally different QCoreApplication Source file to hash Source file to hash. Hash algorithm Hash algorithm. hash comparison hash Show progress Show list all hash algorithm Show list all hash algorithm. Open in gui qcalcfilehash_1.0.7+git20200816.1eb8770/langs/qcalcfilehash_pt_BR.ts0000644000000000000000000001305313716360136023025 0ustar rootroot MainWindow Close Fechar Open Abrir Algorithm: Algoritmo: Calc Calcular Path: Caminho: Check: VerificaУЇУЃo: Compare the hash Comparar hash Copyright 2017-2020 DanSoft. Copyright 2017-2020 DanSoft. All rights reserved. Todos os direitos reservados. Open file Abrir arquivo All Files (*) Todos os Arquivos (*) equally igual different diferente All Files (*.*) а’баЕ б„аАаЙаЛб‹ (*.*) ObjectConsole Invalid positional arguments Argumentos posicionais invУЁlidos Invalid hash argument Argumento de hash invУЁlido Filename: %s Arquivo: %s Result: а аЕаЗбƒаЛбŒб‚аАб‚: Check: %s VerificaУЇУЃo: %s equally igual different diferente Result: %s Resultado: %s QCoreApplication Source file to hash Source file to hash. Arquivo origem para hash Hash algorithm Hash algorithm. Algoritmo de hash hash comparison Hash para comparaУЇУЃo hash hash Show progress Mostrar progresso Show list all hash algorithm Show list all hash algorithm. Mostra lista de todos os algoritmos de hash Open in gui Abrir na GUI Result: а аЕаЗбƒаЛбŒб‚аАб‚: qcalcfilehash_1.0.7+git20200816.1eb8770/ThreadCalcHash.cpp0000644000000000000000000003761213716360136021005 0ustar rootroot#include "ThreadCalcHash.h" #include #include #include #include #include #include #include #include #include const uint_least32_t Crc32Table[256] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; const unsigned char Crc8Table[256] = { 0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15, 0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D, 0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65, 0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D, 0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5, 0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD, 0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85, 0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD, 0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2, 0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA, 0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2, 0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A, 0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32, 0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A, 0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42, 0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A, 0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C, 0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4, 0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC, 0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4, 0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C, 0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44, 0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C, 0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34, 0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B, 0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63, 0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B, 0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13, 0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB, 0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83, 0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB, 0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3 }; ThreadCalcHash::ThreadCalcHash(){ } ThreadCalcHash::~ThreadCalcHash(){ } void ThreadCalcHash::run(){ QString hash=""; emit changeValue(0); std::string filename = _filename.toLocal8Bit().toStdString(); if (_hashAlgorithm==HASH_ALGORITHM::Crc8){ hash = QString::fromStdString(getCrc8FromFile(filename)); } if (_hashAlgorithm==HASH_ALGORITHM::Crc32){ hash = QString::fromStdString(getCrc32FromFile(filename)); } if (_hashAlgorithm==HASH_ALGORITHM::Md4){ hash = QString::fromStdString(getMD4FromFile(filename)); } if (_hashAlgorithm==HASH_ALGORITHM::Md5){ hash = QString::fromStdString(getMD5FromFile(filename)); } if (_hashAlgorithm==HASH_ALGORITHM::Sha1){ hash = QString::fromStdString(getSHA1FromFile(filename)); } if (_hashAlgorithm==HASH_ALGORITHM::Sha224){ hash = QString::fromStdString(getSHA224FromFile(filename)); } if (_hashAlgorithm==HASH_ALGORITHM::Sha256){ hash = QString::fromStdString(getSHA256FromFile(filename)); } if (_hashAlgorithm==HASH_ALGORITHM::Sha384){ hash = QString::fromStdString(getSHA384FromFile(filename)); } if (_hashAlgorithm==HASH_ALGORITHM::Sha512){ hash = QString::fromStdString(getSHA512FromFile(filename)); } emit result(hash.toUpper()); } void ThreadCalcHash::setFilename(QString filename){ _filename=filename; } void ThreadCalcHash::setHashAlgorithm(HASH_ALGORITHM algorithm){ _hashAlgorithm=algorithm; } std::string ThreadCalcHash::getCrc8FromFile(const std::string &filename){ std::stringstream ss; uint64_t allRead=0; int oldProc=0; char *buf = new char[1]; unsigned char crc = 0x00; std::ifstream file(filename, std::ios::binary); if (file){ file.seekg(0, std::ios_base::end); uint64_t fileLen = file.tellg(); file.seekg (0, std::ios::beg); while (file.read(buf,1)){ const unsigned char * b =(const unsigned char *)buf; crc = Crc8Table[crc ^ *b]; allRead++; int proc= allRead*100/fileLen; if (proc!=oldProc){ emit changeValue(proc); oldProc=proc; } } file.close(); } delete[] buf; ss << std::hex << std::setw(2) << std::setfill('0') << (int)crc; return ss.str(); } std::string ThreadCalcHash::getCrc32FromFile(const std::string &filename){ std::stringstream ss; uint64_t allRead=0; int oldProc=0; char *buf = new char[1]; uint_least32_t crc = 0xFFFFFFFF; std::ifstream file(filename, std::ios::binary); if (file){ file.seekg(0, std::ios_base::end); uint64_t fileLen = file.tellg(); file.seekg (0, std::ios::beg); while (file.read(buf,1)){ const unsigned char * b =(const unsigned char *)buf; crc = (crc >> 8) ^ Crc32Table[(crc ^ *b) & 0xFF]; allRead++; int proc= allRead*100/fileLen; if (proc!=oldProc){ emit changeValue(proc); oldProc=proc; } } file.close(); } delete[] buf; ss << std::hex << std::setw(2) << std::setfill('0') << (crc ^ 0xFFFFFFFF); return ss.str(); } std::string ThreadCalcHash::getMD4FromFile(const std::string &filename){ unsigned char buffer_md4[MD4_DIGEST_LENGTH]; MD4_CTX mdContext; std::stringstream ss; std::ifstream file(filename, std::ios_base::binary); if (file){ int countRead=0; uint64_t allRead=0; file.seekg(0, std::ios_base::end); uint64_t nFileLen = file.tellg(); file.seekg (0, std::ios::beg); uint64_t lengthBuffer=1*1024*1024; char * buffer = new char [lengthBuffer+1]; MD4_Init (&mdContext); while((countRead = file.readsome(buffer,lengthBuffer))>0){ if (file){ allRead+=countRead; MD4_Update (&mdContext, buffer,countRead); emit changeValue(allRead*100/nFileLen); } } MD4_Final (buffer_md4,&mdContext); delete[] buffer; for(int i = 0; i < MD4_DIGEST_LENGTH; i++){ ss << std::hex << std::setw(2) << std::setfill('0') << (int)buffer_md4[i]; } file.close(); } return ss.str(); } std::string ThreadCalcHash::getMD5FromFile(const std::string &filename){ unsigned char buffer_md5[MD5_DIGEST_LENGTH]; MD5_CTX mdContext; std::stringstream ss; std::ifstream file(filename, std::ios_base::binary); if (file){ int countRead=0; uint64_t allRead=0; file.seekg(0, std::ios_base::end); uint64_t nFileLen = file.tellg(); file.seekg (0, std::ios::beg); uint64_t lengthBuffer=1*1024*1024; char * buffer = new char [lengthBuffer+1]; MD5_Init (&mdContext); while((countRead = file.readsome(buffer,lengthBuffer))>0){ if (file){ allRead+=countRead; MD5_Update (&mdContext, buffer,countRead); emit changeValue(allRead*100/nFileLen); } } MD5_Final (buffer_md5,&mdContext); delete[] buffer; for(int i = 0; i < MD5_DIGEST_LENGTH; i++){ ss << std::hex << std::setw(2) << std::setfill('0') << (int)buffer_md5[i]; } file.close(); } return ss.str(); } std::string ThreadCalcHash::getSHA1FromFile(const std::string &filename){ unsigned char buffer_sha1[SHA_DIGEST_LENGTH]; SHA_CTX mdContext; std::stringstream ss; std::ifstream file(filename, std::ios_base::binary); if (file){ int countRead=0; uint64_t allRead=0; file.seekg(0, std::ios_base::end); uint64_t nFileLen = file.tellg(); file.seekg (0, std::ios::beg); uint64_t lengthBuffer=1*1024*1024; char * buffer = new char [lengthBuffer+1]; SHA1_Init (&mdContext); while((countRead = file.readsome(buffer,lengthBuffer))>0){ if (file){ allRead+=countRead; SHA1_Update (&mdContext, buffer,countRead); emit changeValue(allRead*100/nFileLen); } } SHA1_Final (buffer_sha1,&mdContext); delete[] buffer; for(int i = 0; i < SHA_DIGEST_LENGTH; i++){ ss << std::hex << std::setw(2) << std::setfill('0') << (int)buffer_sha1[i]; } file.close(); } return ss.str(); } std::string ThreadCalcHash::getSHA224FromFile(const std::string &filename){ unsigned char buffer_sha224[SHA224_DIGEST_LENGTH]; SHA256_CTX mdContext; std::stringstream ss; std::ifstream file(filename, std::ios_base::binary); if (file){ int countRead=0; uint64_t allRead=0; file.seekg(0, std::ios_base::end); uint64_t nFileLen = file.tellg(); file.seekg (0, std::ios::beg); uint64_t lengthBuffer=1*1024*1024; char * buffer = new char [lengthBuffer+1]; SHA224_Init (&mdContext); while((countRead = file.readsome(buffer,lengthBuffer))>0){ if (file){ allRead+=countRead; SHA224_Update (&mdContext, buffer,countRead); emit changeValue(allRead*100/nFileLen); } } SHA224_Final (buffer_sha224,&mdContext); delete[] buffer; for(int i = 0; i < SHA224_DIGEST_LENGTH; i++){ ss << std::hex << std::setw(2) << std::setfill('0') << (int)buffer_sha224[i]; } file.close(); } return ss.str(); } std::string ThreadCalcHash::getSHA256FromFile(const std::string &filename){ unsigned char buffer_sha256[SHA256_DIGEST_LENGTH]; SHA256_CTX mdContext; std::stringstream ss; std::ifstream file(filename, std::ios_base::binary); if (file){ int countRead=0; uint64_t allRead=0; file.seekg(0, std::ios_base::end); uint64_t nFileLen = file.tellg(); file.seekg (0, std::ios::beg); uint64_t lengthBuffer=1*1024*1024; char * buffer = new char [lengthBuffer+1]; SHA256_Init (&mdContext); while((countRead = file.readsome(buffer,lengthBuffer))>0){ if (file){ allRead+=countRead; SHA256_Update (&mdContext, buffer,countRead); emit changeValue(allRead*100/nFileLen); } } SHA256_Final (buffer_sha256,&mdContext); delete[] buffer; for(int i = 0; i < SHA256_DIGEST_LENGTH; i++){ ss << std::hex << std::setw(2) << std::setfill('0') << (int)buffer_sha256[i]; } file.close(); } return ss.str(); } std::string ThreadCalcHash::getSHA384FromFile(const std::string &filename){ unsigned char buffer_sha384[SHA384_DIGEST_LENGTH]; SHA512_CTX mdContext; std::stringstream ss; std::ifstream file(filename, std::ios_base::binary); if (file){ int countRead=0; uint64_t allRead=0; file.seekg(0, std::ios_base::end); uint64_t nFileLen = file.tellg(); file.seekg (0, std::ios::beg); uint64_t lengthBuffer=1*1024*1024; char * buffer = new char [lengthBuffer+1]; SHA384_Init (&mdContext); while((countRead = file.readsome(buffer,lengthBuffer))>0){ if (file){ allRead+=countRead; SHA384_Update (&mdContext, buffer,countRead); emit changeValue(allRead*100/nFileLen); } } SHA384_Final (buffer_sha384,&mdContext); delete[] buffer; for(int i = 0; i < SHA384_DIGEST_LENGTH; i++){ ss << std::hex << std::setw(2) << std::setfill('0') << (int)buffer_sha384[i]; } file.close(); } return ss.str(); } std::string ThreadCalcHash::getSHA512FromFile(const std::string &filename){ unsigned char buffer_sha512[SHA512_DIGEST_LENGTH]; SHA512_CTX mdContext; std::stringstream ss; std::ifstream file(filename, std::ios_base::binary); if (file){ int countRead=0; uint64_t allRead=0; file.seekg(0, std::ios_base::end); uint64_t nFileLen = file.tellg(); file.seekg (0, std::ios::beg); uint64_t lengthBuffer=1*1024*1024; char * buffer = new char [lengthBuffer+1]; SHA512_Init (&mdContext); while((countRead = file.readsome(buffer,lengthBuffer))>0){ if (file){ allRead+=countRead; SHA512_Update (&mdContext, buffer,countRead); emit changeValue(allRead*100/nFileLen); } } SHA512_Final (buffer_sha512,&mdContext); delete[] buffer; for(int i = 0; i < SHA512_DIGEST_LENGTH; i++){ ss << std::hex << std::setw(2) << std::setfill('0') << (int)buffer_sha512[i]; } file.close(); } return ss.str(); } qcalcfilehash_1.0.7+git20200816.1eb8770/QCalcFileHash.pro0000644000000000000000000000516613716360136020613 0ustar rootroot###################################################################### # Automatically generated by qmake (3.0) ?? ??? 25 10:09:31 2016 ###################################################################### TEMPLATE = app TARGET = qcalcfilehash INCLUDEPATH += . DESTDIR = Bin QT += widgets win32:RC_FILE = QCalcFileHash.rc CONFIG(debug, release|debug){ MOC_DIR = .build/debug OBJECTS_DIR = .build/debug UI_DIR = .build/debug RCC_DIR = .build/debug } CONFIG(release, release|debug){ MOC_DIR = .build/release OBJECTS_DIR = .build/release UI_DIR = .build/release RCC_DIR = .build/release } gcc { win32 { INCLUDEPATH += $(CPLUS_INCLUDE_PATH) QMAKE_LIBDIR += $(LIBRARY_PATH) } LIBS += -lssl -lcrypto QMAKE_CXXFLAGS += -std=gnu++11 QMAKE_CXXFLAGS += -pedantic -pedantic-errors QMAKE_CXXFLAGS += -Wall -Wextra -Wformat -Wformat-security -Wno-unused-variable -Wno-unused-parameter DEFINES += HAVE_GCC } TRANSLATIONS = $$files(langs/qcalcfilehash_*.ts) ### install ### isEmpty(QMAKE_LRELEASE) { win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease unix { !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt5 } } else { !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease } } } !win32 { system($${QMAKE_LRELEASE} -silent $${_PRO_FILE_} 2> /dev/null) } win32 { system($${QMAKE_LRELEASE} $${_PRO_FILE_}) } updateqm.input = TRANSLATIONS updateqm.output = langs/${QMAKE_FILE_BASE}.qm updateqm.commands = $$QMAKE_LRELEASE -silent ${QMAKE_FILE_IN} -qm langs/${QMAKE_FILE_BASE}.qm updateqm.CONFIG += no_link target_predeps QMAKE_EXTRA_COMPILERS += updateqm data_bin.path = /usr/bin/ data_bin.files = Bin/qcalcfilehash INSTALLS += data_bin data_app.path = /usr/share/applications/ data_app.files = pkg/qcalcfilehash.desktop INSTALLS += data_app data_langs.path = /usr/share/qcalcfilehash/langs/ data_langs.files = langs/*.qm langs/langs.json INSTALLS += data_langs data_icons16.path = /usr/share/icons/hicolor/16x16/apps/ data_icons16.files = pkg/icons/16x16/qcalcfilehash.png INSTALLS += data_icons16 data_icons32.path = /usr/share/icons/hicolor/32x32/apps/ data_icons32.files = pkg/icons/32x32/qcalcfilehash.png INSTALLS += data_icons32 data_icons48.path = /usr/share/icons/hicolor/48x48/apps/ data_icons48.files = pkg/icons/48x48/qcalcfilehash.png INSTALLS += data_icons48 # Input SOURCES += main.cpp \ mainwindow.cpp \ ThreadCalcHash.cpp \ ObjectConsole.cpp FORMS += \ mainwindow.ui HEADERS += \ mainwindow.h \ ThreadCalcHash.h \ version.h \ ObjectConsole.h