|
Last change
on this file since 58 was 24, checked in by dmik, 19 years ago |
|
QCA: Imported original QCA 1.0 sources from Affinix
|
-
Property svn:keywords
set to
Id
|
|
File size:
534 bytes
|
| Line | |
|---|
| 1 | #include"qca.h"
|
|---|
| 2 | #include<stdio.h>
|
|---|
| 3 |
|
|---|
| 4 | int main(int argc, char **argv)
|
|---|
| 5 | {
|
|---|
| 6 | QCA::init();
|
|---|
| 7 | QCString cs = (argc >= 2) ? argv[1] : "hello";
|
|---|
| 8 |
|
|---|
| 9 | if(!QCA::isSupported(QCA::CAP_SHA1))
|
|---|
| 10 | printf("SHA1 not supported!\n");
|
|---|
| 11 | else {
|
|---|
| 12 | QString result = QCA::SHA1::hashToString(cs);
|
|---|
| 13 | printf("sha1(\"%s\") = [%s]\n", cs.data(), result.latin1());
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | if(!QCA::isSupported(QCA::CAP_MD5))
|
|---|
| 17 | printf("MD5 not supported!\n");
|
|---|
| 18 | else {
|
|---|
| 19 | QString result = QCA::MD5::hashToString(cs);
|
|---|
| 20 | printf("md5(\"%s\") = [%s]\n", cs.data(), result.latin1());
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | return 0;
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.