From 07b7378929c943426becb32f9cfbee2f7f43ceb9 Mon Sep 17 00:00:00 2001 From: bobi Date: Sat, 2 Nov 2019 13:46:43 +0800 Subject: [PATCH] =?UTF-8?q?add:okMd5=E4=BD=BF=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tripartite/okMd5.html | 50 +++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/pages/tripartite/okMd5.html b/pages/tripartite/okMd5.html index 10d796d..763e530 100644 --- a/pages/tripartite/okMd5.html +++ b/pages/tripartite/okMd5.html @@ -8,13 +8,59 @@
+
+

JavaScript版本的MD5实现

+
+
+layui.use(["okMd5"], function () {
+    let okMd5 = layui.okMd5;
+    
+ + // 计算给定字符串值的(十六进制编码的)MD5哈希值 + let hash = okMd5("hello"); + console.log(hash); + + // 计算给定字符串值和key的(十六进制编码的)HMAC-MD5哈希值 + let hash2 = okMd5("hello", "word"); + console.log(hash2); + + // 计算给定字符串值的原始MD5哈希值 + let hash3 = okMd5("hello", null, true) + console.log(hash3); + + // 计算给定字符串值和key的原始HMAC-MD5哈希值 + let hash4 = okMd5("hello", "word", true) + console.log(hash4); +}); +