~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to extra/mysql_password_hash.c

  • Committer: Monty Taylor
  • Date: 2010-08-12 20:27:32 UTC
  • mto: (1720.1.5 build)
  • mto: This revision was merged to the branch mainline in revision 1722.
  • Revision ID: mordred@inaugust.com-20100812202732-9kzchbkvkyki4n3u
Merged libdrizzle directly into tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Drizzle Client & Protocol Library
 
3
 *
 
4
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
 
5
 * All rights reserved.
 
6
 *
 
7
 * Use and distribution licensed under the BSD license.  See
 
8
 * the COPYING file in this directory for full text.
 
9
 */
 
10
 
 
11
#include "config.h"
 
12
 
 
13
#include <stdio.h>
 
14
#include <string.h>
 
15
 
 
16
#include <libdrizzle/drizzle_client.h>
 
17
 
 
18
#define BUFFER_CHUNK 8192
 
19
 
 
20
int main(int argc, char *argv[])
 
21
{
 
22
  char hashed_password[DRIZZLE_MYSQL_PASSWORD_HASH];
 
23
 
 
24
  if (argc != 2)
 
25
  {
 
26
    printf("Usage: %s <password to hash>\n", argv[0]);
 
27
    return 1;
 
28
  }
 
29
 
 
30
  drizzle_mysql_password_hash(hashed_password, argv[1], strlen(argv[1]));
 
31
 
 
32
  printf("%s\n", hashed_password);
 
33
 
 
34
  return 0;
 
35
}