Aeloria Resa <[EMAIL PROTECTED]> writes:

> Well, I like lots of langauges. I'm a happy C++, C, Python, ASM, PHP,
> etc.. programmer. I actually know waaay too many languages, as that is
> one of my hobbies. But, I wrote the code with a little help from a
> complicated console example that didn't work. (Mono doesn't have the
> proper crypto RNG done yet...Oh well. You'd have to use the win32
> compat version.) Anyways, I don't need RNG for hashing.
>
Good.
 
> C# is beginning to grow on me, btw. I didn't need an SHA
> implementation, I needed to know how to use the existing bultin one. :)
> 
Ah; I misunderstood.  You should look into how to do the hash
incrementally instead of using just the ComputeHash call, because
that'll be useful for replicating some fred functionality.

> But, I've done it, so here's my code for all to have.
> 
> Thanks! (This is actually for an alternate node implementation
> eventually, but I'm learning C# now. Toseland: Stop yelling at me now,
> I'm finally writing my own. :p)
> 

>         string result       = Convert.ToBase64String(hashBytes);

One warning about this, freenet doesn't use standard base64 encodings;
there's a custom table of characters that's used (find the Base64.java
file for its contents), as well as one minor circumvention of the spec
with regards to padding.

Thelema
-- 
E-mail: [EMAIL PROTECTED]                            Raabu and Piisu
GPG 1024D/36352AAB fpr:756D F615 B4F3 BFFC 02C7  84B7 D8D7 6ECE 3635 2AAB
_______________________________________________
devl mailing list
[EMAIL PROTECTED]
http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/devl

Reply via email to