[latex3-commits] [latex3/latex3] gh1210-str-mdfive-hash: Add \str_mdfive_hash:n (ad6d29377)

github at latex-project.org github at latex-project.org
Fri May 19 12:17:11 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : gh1210-str-mdfive-hash
Link       : https://github.com/latex3/latex3/commit/ad6d293779a45edfdfc445d0ee8384104c39880d

>---------------------------------------------------------------

commit ad6d293779a45edfdfc445d0ee8384104c39880d
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri May 19 11:16:27 2023 +0100

    Add \str_mdfive_hash:n


>---------------------------------------------------------------

ad6d293779a45edfdfc445d0ee8384104c39880d
 l3kernel/CHANGELOG.md                  |  1 +
 l3kernel/l3str.dtx                     | 13 +++++++++++++
 l3kernel/testfiles/m3str002.luatex.tlg |  6 ++++++
 l3kernel/testfiles/m3str002.lvt        |  8 ++++++++
 l3kernel/testfiles/m3str002.ptex.tlg   |  6 ++++++
 l3kernel/testfiles/m3str002.tlg        |  6 ++++++
 l3kernel/testfiles/m3str002.uptex.tlg  |  6 ++++++
 l3kernel/testfiles/m3str002.xetex.tlg  |  6 ++++++
 8 files changed, 52 insertions(+)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 8f3f6bc24..7bdee565c 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -12,6 +12,7 @@ this project uses date-based 'snapshot' version identifiers.
   one argument from up to nine arguments
 - `\coffin_(g)reset_poles:N`
 - `\int_if_zero:n(TF)`
+- `\str_mdfive_hash:n`
 
 ### Changed
 - Remove `\noexpand` inside math mode in `\text_expand:n`
diff --git a/l3kernel/l3str.dtx b/l3kernel/l3str.dtx
index bb7c1e9f2..6ccb43b3d 100644
--- a/l3kernel/l3str.dtx
+++ b/l3kernel/l3str.dtx
@@ -787,6 +787,13 @@
 %   not to \texttt{\i}).
 % \end{function}
 %
+% \begin{function}[added = 2023-05-19, EXP]{\str_mdfive_hash:n}
+%   \begin{syntax}
+%     \cs{str_mdfive_hash:n} \Arg{str}
+%   \end{syntax}
+%   Expands to the MD5 sum generated from the \meta{str}.
+% \end{function}
+%
 % \section{Viewing strings}
 %
 % \begin{function}[added = 2015-09-18, updated = 2021-04-29]
@@ -2081,6 +2088,12 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}[EXP]{\str_mdfive_hash:n}
+%    \begin{macrocode}
+\cs_new:Npn \str_mdfive_hash:n #1 { \tex_mdfivesum:D {#1} }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{variable}
 %   {
 %     \c_ampersand_str,
diff --git a/l3kernel/testfiles/m3str002.luatex.tlg b/l3kernel/testfiles/m3str002.luatex.tlg
index ca9987304..8b7ed176b 100644
--- a/l3kernel/testfiles/m3str002.luatex.tlg
+++ b/l3kernel/testfiles/m3str002.luatex.tlg
@@ -29,3 +29,9 @@ TEST 4: Characters with context-sensitive Unicode behaviour
 ============================================================
 TRUE
 ============================================================
+============================================================
+TEST 5: MD5 hash
+============================================================
+ACBD18DB4CC2F85CEDEF654FCCC4A4D8
+ACCFBEFDEAC67A70FBD55DFAA45CA92F
+============================================================
diff --git a/l3kernel/testfiles/m3str002.lvt b/l3kernel/testfiles/m3str002.lvt
index 596f37181..904516010 100644
--- a/l3kernel/testfiles/m3str002.lvt
+++ b/l3kernel/testfiles/m3str002.lvt
@@ -56,5 +56,13 @@
     \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl \TRUE \FALSE
   }
 
+\TESTEXP { MD5~hash }
+  {
+    \str_mdfive_hash:n { foo }
+    \NEWLINE
+    \str_mdfive_hash:n { & \par ! ## }
+  }
+
+
 \END
 
diff --git a/l3kernel/testfiles/m3str002.ptex.tlg b/l3kernel/testfiles/m3str002.ptex.tlg
index aebe657ef..2cf6980e6 100644
--- a/l3kernel/testfiles/m3str002.ptex.tlg
+++ b/l3kernel/testfiles/m3str002.ptex.tlg
@@ -29,3 +29,9 @@ TEST 4: Characters with context-sensitive Unicode behaviour
 ============================================================
 FALSE
 ============================================================
+============================================================
+TEST 5: MD5 hash
+============================================================
+ACBD18DB4CC2F85CEDEF654FCCC4A4D8
+2EE44D8E2EBA7C35496E4A82CFD620A0
+============================================================
diff --git a/l3kernel/testfiles/m3str002.tlg b/l3kernel/testfiles/m3str002.tlg
index 51fe29260..1bcd11edf 100644
--- a/l3kernel/testfiles/m3str002.tlg
+++ b/l3kernel/testfiles/m3str002.tlg
@@ -29,3 +29,9 @@ TEST 4: Characters with context-sensitive Unicode behaviour
 ============================================================
 TRUE
 ============================================================
+============================================================
+TEST 5: MD5 hash
+============================================================
+ACBD18DB4CC2F85CEDEF654FCCC4A4D8
+2EE44D8E2EBA7C35496E4A82CFD620A0
+============================================================
diff --git a/l3kernel/testfiles/m3str002.uptex.tlg b/l3kernel/testfiles/m3str002.uptex.tlg
index 574de6c96..e470f77ad 100644
--- a/l3kernel/testfiles/m3str002.uptex.tlg
+++ b/l3kernel/testfiles/m3str002.uptex.tlg
@@ -29,3 +29,9 @@ TEST 4: Characters with context-sensitive Unicode behaviour
 ============================================================
 FALSE
 ============================================================
+============================================================
+TEST 5: MD5 hash
+============================================================
+ACBD18DB4CC2F85CEDEF654FCCC4A4D8
+2EE44D8E2EBA7C35496E4A82CFD620A0
+============================================================
diff --git a/l3kernel/testfiles/m3str002.xetex.tlg b/l3kernel/testfiles/m3str002.xetex.tlg
index ca9987304..f80fc052b 100644
--- a/l3kernel/testfiles/m3str002.xetex.tlg
+++ b/l3kernel/testfiles/m3str002.xetex.tlg
@@ -29,3 +29,9 @@ TEST 4: Characters with context-sensitive Unicode behaviour
 ============================================================
 TRUE
 ============================================================
+============================================================
+TEST 5: MD5 hash
+============================================================
+ACBD18DB4CC2F85CEDEF654FCCC4A4D8
+2EE44D8E2EBA7C35496E4A82CFD620A0
+============================================================





More information about the latex3-commits mailing list.