diff src/luan/modules/Binary.luan @ 1516:70a55f49b98e

digest_message
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 08 Jun 2020 21:54:31 -0600
parents 60f6741f000a
children
line wrap: on
line diff
--- a/src/luan/modules/Binary.luan	Sat May 30 17:58:35 2020 -0600
+++ b/src/luan/modules/Binary.luan	Mon Jun 08 21:54:31 2020 -0600
@@ -1,6 +1,7 @@
 require "java"
 local BinaryLuan = require "java:luan.modules.BinaryLuan"
 local Base64 = require "java:java.util.Base64"
+local MessageDigest = require "java:java.security.MessageDigest"
 
 
 local Binary = {}
@@ -11,4 +12,8 @@
 Binary.byte = BinaryLuan.byte_
 Binary.to_string = BinaryLuan.to_string
 
+function Binary.digest_message(algorithm,input)
+	return MessageDigest.getInstance(algorithm).digest(input)
+end
+
 return Binary