# HG changeset patch # User Matthew Wild # Date 1530123471 -3600 # Node ID f35cfdff31b6d8031ef2a323c1ea28ffd9df3ded # Parent 459305b2314f100be0683534622a185790cb45a9 libs.hashes: Add support for sha1 lib from luarocks diff -r 459305b2314f -r f35cfdff31b6 libs/hashes.lua --- 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;