Thread overview
MD5, SHA1, SHA256, CRC32
Apr 10, 2012
Russel Winder
Apr 10, 2012
Walter Bright
Apr 10, 2012
Adam D. Ruppe
Apr 10, 2012
Piotr Szturmaj
Apr 10, 2012
Manu
Apr 10, 2012
Piotr Szturmaj
Apr 11, 2012
Kai Nacke
Apr 10, 2012
Ellery Newcomer
Apr 11, 2012
Regan Heath
April 10, 2012
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.

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 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


April 10, 2012
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

April 10, 2012
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:

https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/sha.d

assert(hashToString(SHA1("abc")) == "a9993e364706816aba3e25717850c26c9cd0d89d");
assert(hashToString(SHA256("abc")) == "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad");

April 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:
>
> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/sha.d

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)
April 10, 2012
On 10 April 2012 20:41, Piotr Szturmaj <bncrbme@jadamspam.pl> wrote:

> 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:
>>
>> https://github.com/adamdruppe/**misc-stuff-including-D-** programming-language-web-**stuff/blob/master/sha.d<https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/sha.d>
>>
>
> 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?


April 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)
April 10, 2012
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.
>
April 11, 2012
On 10.04.2012 20:12, Manu wrote:
> On 10 April 2012 20:41, Piotr Szturmaj <bncrbme@jadamspam.pl
> <mailto:bncrbme@jadamspam.pl>> wrote:
>
>     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:
>
>         https://github.com/adamdruppe/__misc-stuff-including-D-__programming-language-web-__stuff/blob/master/sha.d
>         <https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/sha.d>
>
>
>     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
April 11, 2012
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/