changeset 1516:70a55f49b98e

digest_message
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 08 Jun 2020 21:54:31 -0600
parents 78d937870762
children 04615093b19d
files src/luan/modules/Binary.luan
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
diff -r 78d937870762 -r 70a55f49b98e src/luan/modules/Binary.luan
--- 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