• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

3.2 Hashes and digests
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog SSL Interface
        • library(crypto): Cryptography and authentication library
          • Hashes and digests
            • crypto_data_hash/3
            • crypto_file_hash/3
            • hex_bytes/2
            • crypto_context_new/2
            • crypto_data_context/3
            • crypto_context_hash/2
            • crypto_open_hash_stream/3
            • crypto_stream_hash/2
Availability::- use_module(library(crypto)).(can be autoloaded)
Source[det]crypto_data_hash(+Data, -Hash, +Options)
Hash is the hash of Data. The conversion is controlled by Options:
algorithm(+Algorithm)
One of md5, sha1, sha224, sha256 (default), sha384, sha512, blake2s256 or blake2b512. The BLAKE digest algorithms require OpenSSL 1.1.0 or greater.
encoding(+Encoding)
If Data is a sequence of character codes, this must be translated into a sequence of bytes, because that is what the hashing requires. The default encoding is utf8. The other meaningful value is octet, claiming that Data contains raw bytes.
hmac(+Key)
If this option is specified, a hash-based message authentication code (HMAC) is computed, using the specified Key which is either an atom or string. Any of the available digest algorithms can be used with this option. The cryptographic strength of the HMAC depends on that of the chosen algorithm and also on the key. This option requires OpenSSL 1.1.0 or greater.
Data is either an atom, string or code-list
Hash is an atom that represents the hash.
See also
hex_bytes/2 for conversion between hashes and lists.
ClioPatria (version V3.0.0-338-gc91dba5-DIRTY)