Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.security > #81

Re: MessageDigest Length

From "Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Subject Re: MessageDigest Length
Message-ID <18ffu3pk481oj53l8r9lo2mup743voi3d5@4ax.com> (permalink)
Newsgroups comp.lang.java.security
References <47e524f6$0$14360$e4fe514c@news.xs4all.nl>
Date 2011-04-27 16:08 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.security
On Sat, 22 Mar 2008 16:25:42 +0100, Maarten Bodewes
<maarten.bodewes@xs4all.nl> wrote, quoted or indirectly quoted someone
who said :

>> Does anyone know if there is a way of setting the length of the hashed
>> value returned from a message digest?

There is not much point in generating a 256 bit digest then using only
the first 16 bits.  You can same yourself considerable CPU cycles by
generating a 16 bit digest directly . 

Just pick an algorithm with the size you want. For a list of
algorithms see http://mindprod.com/jgloss/digest.html

Short ones are usually called "checksums".

-- 

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.security | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

MessageDigest Length "sean" <sean@THRWHITE.remove-dii-this> - 2011-04-27 16:07 +0000
  Re: MessageDigest Length "Robert Kochem" <robert.kochem@THRWHITE.remove-dii-this> - 2011-04-27 16:07 +0000
    Re: MessageDigest Length "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:07 +0000
  Re: MessageDigest Length "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:07 +0000
  Re: MessageDigest Length "Maarten Bodewes" <maarten.bodewes@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
    Re: MessageDigest Length "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
      Re: MessageDigest Length "Maarten Bodewes" <maarten.bodewes@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
        Re: MessageDigest Length "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
        Re: MessageDigest Length "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
        Re: MessageDigest Length "rmoldskr+usenet" <rmoldskr+usenet@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000

csiph-web