libs/hashes.lua

changeset 421
f35cfdff31b6
parent 414
2a5eff919f4a
child 422
ff59e4a1a600
--- a/libs/hashes.lua	Wed Jun 27 19:16:25 2018 +0100
+++ b/libs/hashes.lua	Wed Jun 27 19:17:51 2018 +0100
@@ -44,4 +44,14 @@
 	_M.hmac_sha512 = sha512.hmac.digest;
 end);
 
+with("sha1", function (sha1)
+	_M.sha1 = function (data, hex)
+		if hex then
+			return sha1.sha1(data);
+		else
+			return (sha1.binary(data));
+		end
+	end;
+end);
+
 return _M;

mercurial