~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/cube2hash/hashstring.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "cube2crypto.h"
 
2
#include <stdlib.h>
 
3
#include <stdio.h>
 
4
 
 
5
#define EXIT_FAILURE 1
 
6
#define EXIT_SUCCESS 0
 
7
 
 
8
void help()
 
9
{
 
10
        printf("Usage: hashstring <seed>\n");
 
11
}
 
12
 
 
13
int main(int argc, char **argv)
 
14
{
 
15
        if(argc != 2 || !argv[1])
 
16
        {
 
17
                help();
 
18
                return EXIT_FAILURE;
 
19
        }
 
20
 
 
21
        char *answer = cube2crypto_hashstring(argv[1]);
 
22
 
 
23
        printf("hash value: %s\n", answer);
 
24
 
 
25
        free(answer);
 
26
 
 
27
        return EXIT_SUCCESS;
 
28
}