axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Base32 encoder needed


From: Martin Rubey
Subject: Re: [Axiom-developer] Base32 encoder needed
Date: 23 Apr 2007 14:46:52 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

C Y <address@hidden> writes:

> I don't know if this is what you're after (plus, it's GPL) but there is
> this:
> 
> http://darcs.informatimago.com/darcs/public/lisp/common-lisp/rfc3548.lisp


Yes, that's exactly what I was after.  I stick with md5sum for the moment,
since this has "compression" built in, but together with

http://common-lisp.net/project/gzip-stream/

it is certainly better than md5.

Note that my code is quite flexible with respect to this problem.  The function
in question is

        getSpecification(op: IndexCard): String == 
            s: String := concat([op.'name, "`", op.'type, "`", op.'origin])
            systemCommand("sys rm myspec")$MoreSystemCommands
            f: TextFile := open("myspec"::FileName, "output")
            writeLine!(f, s)
            close! f
            systemCommand("sys md5sum myspec > md5spec")$MoreSystemCommands
            f: TextFile := open("md5spec"::FileName, "input")
            r := readLine! f
            close! f
            r.(1..32)

It's sole purpose is to translate

            s: String := concat([op.'name, "`", op.'type, "`", op.'origin])

at least injectively into a filename.  As you can see it currently uses file IO
and md5sum, even though md5 is not injective, but nearly...

But it would be better to avoid file IO and call these two lisp utilities
instead.  And of course, the proper way would be to write a tiny wrapper
package for rfc3548.lisp and another one for gzip-stream, but I'm not going to
do it.

Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]