Re: md5sum and sha1sum functions

I agree with Sandro that we should have sha1, sha224, sha256, sha384 and 
sha512.

Whether they are named or have a length parameters (for certain fixed 
values only), I don't much mind.  Does anyone want the ability to switch 
at runtime on a per-call basis? sha256(s) and sha(s, len) is also possible.

FYI: Apache common codec does not have sha224.  Searching, I find that 
sha224 is an addition of Feb 2004 and is a truncated SHA-2 256.


On 03/12/10 23:04, Paul Gearon wrote:
> As discussed in the last teleconf, I would like to propose the include
> of an "md5sum" function, in a similar fashion to MySQL.

Fine tuning: Just MD5() and SHA1()?

md5sum is the name of a program that generates md5 checksums.

(I know FOAF uses mbox_sha1sum but it also has the experimental 
foaf:sha1 for documents).

> MD5SUM is often used for storing passwords. SHA1SUM is used in a
> similar way, and is also used for hashing email addresses in FOAF.
>
> ---
>
> MD5SUM
>
> The MD5SUM function accepts a single plain literal argument and
> returns a simple literal containing a string of exactly 32 characters.
> Each character represents a hexadecimal digit and is one of [0-9a-f].

Is plain literal the right choice here?

Either of

   simple literal
   simple literal+xsd:string

make more sense to me

The case of plain+lang seems to me to be a bad choice as the checksum 
does not include the language tag.

	Andy
...

>
> ?r
> --
> "f96b697d7cb7938d525a2f31aaf161d0"

?r => ?m

Received on Monday, 6 December 2010 12:26:38 UTC