This library provides a lightweight implementation for computing SHA
secure hashes. A general secure hash interface is provided by
library(crypto), part of the ssl
package.
sha1
(default), sha224
, sha256
, sha384
or
sha512
utf8
. The
other meaningful value is octet
, claiming that Data contains
raw bytes.This predicate allows a SHA function to be computed in chunks, which may be important while working with Metalink (RFC 5854), BitTorrent or similar technologies, or simply with big files.
sha1sum
program found in many systems.?- sha_hash('SWI-Prolog', Hash, []), hash_atom(Hash, Hex). Hash = [61, 128, 252, 38, 121, 69, 229, 85, 199|...], Hex = '3d80fc267945e555c730403bd0ab0716e2a68c68'.