summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/md5.h
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2008-06-10 13:20:05 +0000
committerAntoine Cellerier <dionoea@videolan.org>2008-06-10 13:20:05 +0000
commit34d4165f7b8a36419c417f164ccdebbe04808247 (patch)
tree236281d7a79b46322564ba0506b0178e864a9291 /apps/plugins/lib/md5.h
parentf52696ef8a6e46b8379a0b2bc3d0661df3f9312e (diff)
downloadrockbox-34d4165f7b8a36419c417f164ccdebbe04808247.tar.gz
rockbox-34d4165f7b8a36419c417f164ccdebbe04808247.zip
New md5sum plugin. Open a file, a directory or just launch it from the plugin menu to create an md5sum of the file, the directory's contents or the whole filesystem. If the file's extension is .md5 or .md5sum, it will check the md5 sums in the file instead. If the file's extension is .md5list it will compute md5 sums for all the files listed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17709 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/md5.h')
-rw-r--r--apps/plugins/lib/md5.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/apps/plugins/lib/md5.h b/apps/plugins/lib/md5.h
new file mode 100644
index 0000000000..e19c749664
--- /dev/null
+++ b/apps/plugins/lib/md5.h
@@ -0,0 +1,56 @@
1/*****************************************************************************
2 * vlc_md5.h: MD5 hash
3 *****************************************************************************
4 * Copyright (C) 2004-2005 the VideoLAN team
5 * $Id: 46f10f01439edbcc8bad45673cc302039b76dd5b $
6 *
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Sam Hocevar <sam@zoy.org>
9 *
10 * Adapted to Rockbox by: Antoine Cellerier <dionoea at videolan dot org>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
26
27#ifndef _VLC_MD5_H
28# define _VLC_MD5_H
29
30void md5_init( const struct plugin_api * );
31
32/*****************************************************************************
33 * md5_s: MD5 message structure
34 *****************************************************************************
35 * This structure stores the static information needed to compute an MD5
36 * hash. It has an extra data buffer to allow non-aligned writes.
37 *****************************************************************************/
38struct md5_s
39{
40 uint64_t i_bits; /* Total written bits */
41 uint32_t p_digest[4]; /* The MD5 digest */
42 uint32_t p_data[16]; /* Buffer to cache non-aligned writes */
43};
44
45void InitMD5( struct md5_s * );
46void AddMD5( struct md5_s *, const void *, size_t );
47void EndMD5( struct md5_s * );
48
49/**
50 * Returns a char representation of the md5 hash, as shown by UNIX md5 or
51 * md5sum tools.
52 */
53#define MD5_STRING_LENGTH 32
54void psz_md5_hash( char *, struct md5_s * );
55
56#endif