On 10/16/2015 05:38 PM, Emanuele De Cupis wrote:
> Hi Jan,
> that's brilliant - i skipped it as I red "deprecated", shame on me.
> However, why the following predicate fails?
> rdf_atom_md5("long live and prosper", 1,
?- "bf1835ce984d2a97d31409394fe00e9a" = 'bf1835ce984d2a97d31409394fe00e9a'.
Typically predicates that need `text' in SWI-Prolog are flexible on the
input representation, but dictate a specific output and just unify the
Cheers --- Jan
> Il giorno venerdì 16 ottobre 2015 17:07:13 UTC+2, Jan Wielemaker ha scritto:
> On 10/16/2015 04:56 PM, Emanuele De Cupis wrote:
> > Hi all,
> > I'm new in prolog and I have an unaswered question.
> > I'm trying to write a /md5/ predicate that verifies the following:
> > md5("my string", "my md5").
> > A truth instance of such predicate would be
> > md5("long live and prosper", "bf1835ce984d2a97d31409394fe00e9a").
> > I looked into docs, and I found this:
> > http://www.swi-prolog.org/pldoc/doc_for?object=crypt/2
> This follows Unix MD5 password encryption (which is deprecated in
> the meanwhile). It does a lot more then just MD5. Plain MD5 is
> available from library(semweb/rdf_db):
> ?- use_module(library(semweb/rdf_db)).
> ?- rdf_atom_md5("long live and prosper", 1, X).
> X = bf1835ce984d2a97d31409394fe00e9a.
> Hopefully Julio will come with a nice binding to the SSL crypto
> functions and you can do this and a lot more in a uniform way.
> As is, various crypto primitives a are all over the place.
> Cheers --- Jan
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> Visit this group at http://groups.google.com/group/swi-prolog
> For more options, visit https://groups.google.com/d/optout