## digitalmars.D - MD5, SHA1, SHA256, CRC32

• Russel Winder (15/15) Apr 10 2012 I'm in need of calculating these numbers as part of a program. Java,
• Walter Bright (6/10) Apr 10 2012 The crc32 and md5 are two of them. Nobody has done the others. I know th...
• Adam D. Ruppe (11/11) Apr 10 2012 There's a few of us who have written our own
• Piotr Szturmaj (4/11) Apr 10 2012 And here's mine:
• Manu (4/19) Apr 10 2012 I've needed these the past few days too.. what makes this one unsuitable
• Piotr Szturmaj (5/13) Apr 10 2012 Incompleteness :) I'm currently working on a commercial project and I
• Kai Nacke (4/22) Apr 11 2012 Just see the discussion here:
• Ellery Newcomer (3/8) Apr 10 2012 you might see if the tango d2 port impls are working
• Regan Heath (7/9) Apr 11 2012 Those were mine (originally) and I am happy to contribute the original
Russel Winder <russel winder.org.uk> writes:
```I'm in need of calculating these numbers as part of a program.  Java,
Python, Go, all provide these algorithms "out of the box".  From what I
can see D does not.  There is a crc32 module and a std/md5 module but...

Have I just missed something?

Thanks.

--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
```
Apr 10 2012
Walter Bright <newshound2 digitalmars.com> writes:
```On 4/10/2012 2:25 AM, Russel Winder wrote:
I'm in need of calculating these numbers as part of a program.  Java,
Python, Go, all provide these algorithms "out of the box".  From what I
can see D does not.  There is a crc32 module and a std/md5 module but...

Have I just missed something?

The crc32 and md5 are two of them. Nobody has done the others. I know the md5
one is a straightforward translation from the C version. The others could be
done the same way.

Also, there's:

https://github.com/D-Programming-Deimos/openssl
```
Apr 10 2012
"Adam D. Ruppe" <destructionator gmail.com> writes:
```There's a few of us who have written our own
implementations of these, but as far as I know
none of them are considered good enough for
stdlib.

But if you just want something you can use now,
here's mine for sha:

assert(hashToString(SHA1("abc")) ==
"a9993e364706816aba3e25717850c26c9cd0d89d");
assert(hashToString(SHA256("abc")) ==
```
Apr 10 2012
```Adam D. Ruppe wrote:
There's a few of us who have written our own
implementations of these, but as far as I know
none of them are considered good enough for
stdlib.

But if you just want something you can use now,
here's mine for sha:

And here's mine:
https://github.com/pszturmaj/phobos/blob/master/std/crypto/hash/sha.d
(yeah, I need to move it to a new branch)
```
Apr 10 2012
Manu <turkeyman gmail.com> writes:
```On 10 April 2012 20:41, Piotr Szturmaj <bncrbme jadamspam.pl> wrote:

There's a few of us who have written our own
implementations of these, but as far as I know
none of them are considered good enough for
stdlib.

But if you just want something you can use now,
here's mine for sha:

And here's mine: https://github.com/pszturmaj/**
phobos/blob/master/std/crypto/**hash/sha.d<https://github.com/pszturmaj/phobos/blob/master/std/cryp
o/hash/sha.d>(yeah, I need to move it to a new branch)

I've needed these the past few days too.. what makes this one unsuitable
for std? I see you've put it in the std namespace ;)
Is there something holding it back?
```
Apr 10 2012
```Manu wrote:
On 10 April 2012 20:41, Piotr Szturmaj <bncrbme jadamspam.pl
And here's mine:
https://github.com/pszturmaj/__phobos/blob/master/std/crypto/__hash/sha.d
<https://github.com/pszturmaj/phobos/blob/master/std/crypto/hash/sha.d>
(yeah, I need to move it to a new branch)

I've needed these the past few days too.. what makes this one unsuitable
for std? I see you've put it in the std namespace ;)
Is there something holding it back?

Incompleteness :) I'm currently working on a commercial project and I
don't have much time for this.

http://prowiki.org/wiki4d/wiki.cgi?CryptoDevel (any help will be
appreciated)
```
Apr 10 2012
Kai Nacke <kai redstar.de> writes:
```On 10.04.2012 20:12, Manu wrote:
On 10 April 2012 20:41, Piotr Szturmaj <bncrbme jadamspam.pl

There's a few of us who have written our own
implementations of these, but as far as I know
none of them are considered good enough for
stdlib.

But if you just want something you can use now,
here's mine for sha:

And here's mine:
https://github.com/pszturmaj/__phobos/blob/master/std/crypto/__hash/sha.d
<https://github.com/pszturmaj/phobos/blob/master/std/crypto/hash/sha.d>
(yeah, I need to move it to a new branch)

I've needed these the past few days too.. what makes this one unsuitable
for std? I see you've put it in the std namespace ;)
Is there something holding it back?

Just see the discussion here:
https://github.com/D-Programming-Language/phobos/pull/221

Kai
```
Apr 11 2012
Ellery Newcomer <ellery-newcomer utulsa.edu> writes:
```you might see if the tango d2 port impls are working

https://github.com/SiegeLord/Tango-D2/tree/d2port/tango/util/digest

On 04/10/2012 04:25 AM, Russel Winder wrote:
I'm in need of calculating these numbers as part of a program.  Java,
Python, Go, all provide these algorithms "out of the box".  From what I
can see D does not.  There is a crc32 module and a std/md5 module but...

Have I just missed something?

Thanks.

```
Apr 10 2012
"Regan Heath" <regan netmail.co.nz> writes:
```On Tue, 10 Apr 2012 20:34:22 +0100, Ellery Newcomer
<ellery-newcomer utulsa.edu> wrote:

you might see if the tango d2 port impls are working

https://github.com/SiegeLord/Tango-D2/tree/d2port/tango/util/digest

Those were mine (originally) and I am happy to contribute the original
versions to anyone who needs them.

Regan

--
Using Opera's revolutionary email client: http://www.opera.com/mail/
```
Apr 11 2012