~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to extra/mysql_password_hash.c

  • Committer: Monty Taylor
  • Date: 2011-02-12 18:56:22 UTC
  • mto: (2165.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110212185622-nmvhgqc34iwja75a
Merged in outstanding changes from the win32 work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
#include "config.h"
39
39
 
40
 
#include <iostream>
 
40
#include <stdio.h>
 
41
#include <string.h>
41
42
 
42
43
#include <libdrizzle/drizzle_client.h>
43
44
 
44
 
static const uint32_t BUFFER_CHUNK= 8192;
 
45
#define BUFFER_CHUNK 8192
45
46
 
46
47
int main(int argc, char *argv[])
47
48
{
49
50
 
50
51
  if (argc != 2)
51
52
  {
52
 
    std::cerr << "Usage: " << argv[0] << " <password to hash>" << std::endl;
 
53
    printf("Usage: %s <password to hash>\n", argv[0]);
53
54
    return 1;
54
55
  }
55
56
 
56
57
  drizzle_mysql_password_hash(hashed_password, argv[1], strlen(argv[1]));
57
58
 
58
 
  std::cout << hashed_password << std::endl;
 
59
  printf("%s\n", hashed_password);
59
60
 
60
61
  return 0;
61
62
}