Re: [NTG-context] SHA512 for LuaTeX-5.2

2018-07-23 Thread Pablo Rodriguez
On 07/23/2018 06:23 PM, Hans Hagen wrote: > On 7/23/2018 6:04 PM, Pablo Rodriguez wrote: >> [...] >> Would it be possible to use the function to hash external binary files? >> >> Many thanks for your help, > > utilities.sha2.hash512(io.loaddata("foo.bin")) > > on the average it's fast enough

Re: [NTG-context] SHA512 for LuaTeX-5.2

2018-07-23 Thread Hans Hagen
On 7/23/2018 6:04 PM, Pablo Rodriguez wrote: On 07/23/2018 05:42 PM, Hans Hagen wrote: On 7/23/2018 4:51 PM, Pablo Rodriguez wrote: On 07/22/2018 10:56 PM, Hans Hagen wrote: why not use utilities.sha2.hash512(str) Many thanks for your reply, Hans. \starttext

Re: [NTG-context] SHA512 for LuaTeX-5.2

2018-07-23 Thread Pablo Rodriguez
On 07/23/2018 05:42 PM, Hans Hagen wrote: > On 7/23/2018 4:51 PM, Pablo Rodriguez wrote: >> On 07/22/2018 10:56 PM, Hans Hagen wrote: >>> why not use >>> >>> utilities.sha2.hash512(str) >> >> Many thanks for your reply, Hans. >> >> \starttext >>

Re: [NTG-context] SHA512 for LuaTeX-5.2

2018-07-23 Thread Hans Hagen
On 7/23/2018 4:51 PM, Pablo Rodriguez wrote: On 07/22/2018 10:56 PM, Hans Hagen wrote: why not use utilities.sha2.hash512(str) Many thanks for your reply, Hans. \starttext \def\hashfive#1{\ctxlua{context(utilities.sha2.hash512("#1"))}} \hashfive{a} \stoptext ConTeXt

Re: [NTG-context] SHA512 for LuaTeX-5.2

2018-07-23 Thread Pablo Rodriguez
On 07/22/2018 10:56 PM, Hans Hagen wrote: > why not use > > utilities.sha2.hash512(str) Many thanks for your reply, Hans. \starttext \def\hashfive#1{\ctxlua{context(utilities.sha2.hash512("#1"))}} \hashfive{a} \stoptext ConTeXt complains: [ctxlua]:1: attempt to index field

Re: [NTG-context] SHA512 for LuaTeX-5.2

2018-07-22 Thread Hans Hagen
On 7/22/2018 6:45 PM, Pablo Rodriguez wrote: Dear list, I have the following sample (adapted from > ... > I’m afraid I cannot make it working, since LuaTeX complains about hash512 being nil. Could anyone explain me what I’m doing wrong? Many thanks fory your help, why not use

[NTG-context] SHA512 for LuaTeX-5.2

2018-07-22 Thread Pablo Rodriguez
Dear list, I have the following sample (adapted from https://stackoverflow.com/q/50442185): ✂️ \starttext \startlua -- -- UTILITY FUNCTIONS -- -- transform a string of bytes in a string of hexadecimal digits local function str2hexa (s)