From 0090695f7d79efa4f50398b55bc59317d1de1d75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= <flashcode@flashtux.org>
Date: Tue, 16 Aug 2022 21:25:30 +0200
Subject: api: add function crypto_hash_file

---
 doc/it/weechat_plugin_api.it.adoc | 44 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

(limited to 'doc/it/weechat_plugin_api.it.adoc')

diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc
index c0d0d81c6..26cdf1144 100644
--- a/doc/it/weechat_plugin_api.it.adoc
+++ b/doc/it/weechat_plugin_api.it.adoc
@@ -3894,6 +3894,50 @@ rc = weechat_crypto_hash (data, strlen (data), "sha256", hash, &hash_size);
 [NOTE]
 Questa funzione non è disponibile nelle API per lo scripting.
 
+// TRANSLATION MISSING
+==== crypto_hash_file
+
+_WeeChat ≥ 3.7._
+
+Compute hash of a file.
+
+Prototipo:
+
+[source,c]
+----
+int weechat_crypto_hash_file (const char *filename, const char *hash_algo,
+                              void *hash, int *hash_size);
+----
+
+Argomenti:
+
+* _filename_: percorso e nome file
+* _hash_algo_: the hash algorithm, see table in function
+  <<crypto_hash_algorithms,crypto_hash>>
+* _hash_: pointer to the hash variable, which is used to store the resulting hash
+  (the buffer must be large enough, according to the algorithm, see table in
+  function <<crypto_hash_algorithms,crypto_hash>>)
+* _hash_size_: pointer to a variable used to store the length of the hash computed
+  (in bytes) (can be NULL)
+
+Valore restituito:
+
+* 1 if OK, 0 if error
+
+Esempio in C:
+
+[source,c]
+----
+char hash[256 / 8];
+int rc, hash_size;
+rc = weechat_crypto_hash_file ("/path/to/file", "sha256", hash, &hash_size);
+/* rc == 1, hash_size == 32 and hash is a buffer with:
+   71 c4 80 df 93 d6 ae 2f 1e fa d1 44 7c 66 c9 52 5e 31 62 18 cf 51 fc 8d 9e d8 32 f2 da f1 8b 73 */
+----
+
+[NOTE]
+Questa funzione non è disponibile nelle API per lo scripting.
+
 // TRANSLATION MISSING
 ==== crypto_hash_pbkdf2
 
-- 
cgit v1.2.3

