atom_final_md5(+atom)

Calculate the MD5 digest value, encode it with base64 and unify that atom with the argument.

The MD5 message-digest algorithm takes one or more Prolog atoms as input and calculates a 128 bit number which can act as a fingerprint of the input. It is conjectured that it is computationally infeasible to produce two different messages having the same message digest, or to produce a message having a given prespecified target message digest.
The MD5 algorithm is described in RFC 1321. RFC documents can be retrieved from www.rfc-editor.org/rfc.html.

see also: atom_base64/2 atom_codes/2 atom_compress/2 atom_concat/3 atom_encrypt/3 atom_integers/2 atom_length/2 atom_reset_md5/0 atom_update_md5/1 char_code/2 number_chars/2 md5_file/2 number_codes/2 number_integers/2 sub_atom/5

Example
atom_update_md5('another'),
atom_final_md5(D).
D = 'sy1z5W7Jm8Xsj4OHHN5wig=='
atom_update_md5('another'),
atom_update_md5('value'),
atom_final_md5(D).
D = 'L6/4wbvp/W/9+BKEBixSnA=='

 

Exceptions  
argument Arg is not an atom nor a variable an type_error(atom, Arg) exception is thrown

 

 

info@trinc-prolog.com