svn commit: trunk/busybox: coreutils libbb

aldot at busybox.net aldot at busybox.net
Tue Jan 17 12:07:04 UTC 2006


Author: aldot
Date: 2006-01-17 04:07:03 -0800 (Tue, 17 Jan 2006)
New Revision: 13383

Log:
- make CONFIG_MD5SUM_SIZE_VS_SPEED configurable via menuconfig.
- use shorter boilerplate.


Modified:
   trunk/busybox/coreutils/Config.in
   trunk/busybox/libbb/hash_fd.c


Changeset:
Modified: trunk/busybox/coreutils/Config.in
===================================================================
--- trunk/busybox/coreutils/Config.in	2006-01-17 10:01:28 UTC (rev 13382)
+++ trunk/busybox/coreutils/Config.in	2006-01-17 12:07:03 UTC (rev 13383)
@@ -323,6 +323,21 @@
 	help
 	  md5sum is used to print or check MD5 checksums.
 
+config CONFIG_MD5SUM_SIZE_VS_SPEED
+	int "  Trade Bytes for Speed"
+	default 2
+	range 0 3
+	depends on CONFIG_MD5SUM
+	help
+	  Trade binary size versus speed for the md5sum algorithm.
+	  Approximate values running uClibc and hashing
+	  linux-2.4.4.tar.bz2 were:
+	                    user times (sec)  text size (386)
+	  0 (fastest)         1.1                6144
+	  1                   1.4                5392
+	  2                   3.0                5088
+	  3 (smallest)        5.1                4912
+
 config CONFIG_MKDIR
 	bool "mkdir"
 	default n

Modified: trunk/busybox/libbb/hash_fd.c
===================================================================
--- trunk/busybox/libbb/hash_fd.c	2006-01-17 10:01:28 UTC (rev 13382)
+++ trunk/busybox/libbb/hash_fd.c	2006-01-17 12:07:03 UTC (rev 13383)
@@ -5,19 +5,7 @@
  *  Copyright (C) 2003 Glenn L. McGrath
  *  Copyright (C) 2003 Erik Andersen
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
  */
 
 #include <byteswap.h>
@@ -271,7 +259,11 @@
  *     3 (smallest)        5.1                4912
  */
 
+# if CONFIG_MD5SUM_SIZE_VS_SPEED < 0 || CONFIG_MD5SUM_SIZE_VS_SPEED > 3
 # define MD5SUM_SIZE_VS_SPEED 2
+# else
+# define MD5SUM_SIZE_VS_SPEED CONFIG_MD5SUM_SIZE_VS_SPEED
+# endif
 
 /* Handle endian-ness */
 # if __BYTE_ORDER == __LITTLE_ENDIAN




More information about the busybox-cvs mailing list