[NTG-context] workaround for wrapping SHA512

2023-10-05 Thread Pablo Rodriguez
Dear list, I have just added another workaround to long hashes (such as SHA512). It interleaves colons every two chars: https://wiki.contextgarden.net/Wrapping#Another_workaround_interleaving_colons. This makes a longer output, but it is more readable too. Just in case it helps anyone (who

Re: [NTG-context] hash for buffer contents

2022-09-22 Thread Pablo Rodriguez via ntg-context
Many thanks for your reply, Max. This is exactly what I needed. >\starttext >\startluacode >require("util-sha") > >local content = buffers.getcontent("test") >-- local content = buffers.raw("test") -- same result >loc

Re: [NTG-context] hash for buffer contents

2022-09-21 Thread Max Chernoff via ntg-context
text \startluacode require("util-sha") local content = buffers.getcontent("test") -- local content = buffers.raw("test") -- same result local sha512 = utilities.sha2.hash512(content) context(sha512) \stopluacode \stoptext De

[NTG-context] getting sha512 from text in buffer

2021-12-01 Thread Pablo Rodriguez via ntg-context
Dear list, I have this minimal sample: \ctxlua{require("util-sha")} \def\sha#1{% \ctxlua{context(utilities.sha2.hash512("#1"))}} \startbuffer[text] hola \stopbuffer \starttext \sha{hola} \sha{\typebuffer[text]} \stoptext How can I get that both commands get the same

[NTG-context] util-sha.lua misbehaving?

2019-02-28 Thread Pablo Rodriguez
44241e9d. I don’t know whether my invocation of io.loaddata is wrong, since the SHA512 for the text "i-context.pdf" is 2ac2778b, which is the same result as https://duckduckgo.com/?q=sha512+i-context.pdf. After discovering that io.loaddata is from l-io.lua, I don’t know what I may

Re: [NTG-context] luatex on the garden

2018-08-31 Thread Hans Hagen
thanks for the new LuaTeX, Hans. I have used for a document (http://blog.ousia.tk/0005/#context-source), which hashes (with both SHA512 and SHA256) 38 external files. With the previous beta, it took about 160s to completely generate the PDF output (always with --purgeall). With the current beta

Re: [NTG-context] luatex on the garden

2018-08-31 Thread Pablo Rodriguez
ans. I have used for a document (http://blog.ousia.tk/0005/#context-source), which hashes (with both SHA512 and SHA256) 38 external files. With the previous beta, it took about 160s to completely generate the PDF output (always with --purgeall). With the current beta, it only took 9.9s, whi

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)

Re: [NTG-context] \nopdfcompression and no date information

2018-06-24 Thread Pablo Rodriguez
er because this is a feature creep option but > you can try > > \enabledirectives[backend.date=no] Many thanks for your reply, Hans. The use is totally focused in a single file that I would like to recreate if needed (having the exact SHA512). Many thanks for

[NTG-context] bug with special hyphenation?

2018-02-08 Thread Pablo Rodriguez
ethyphenationfeatures[sha]% \setuphyphenation[method=traditional]% #1% \endgroup} \showframe \starttext some sha \sha{8b984688efec2}.\par \sha{8b984688efec2}\hskip0pt.\par {\sha{8b984688efe3a}\hskip0pt.}\par \stoptext Just in c

Re: [NTG-context] how to hyphenate SHA512?

2017-07-10 Thread Pablo Rodriguez
On 07/08/2017 01:32 PM, Hans Hagen wrote: > On 7/7/2017 10:28 PM, josephcan...@gmail.com wrote: >> A probably quick and dirty « solution », which consists in inserting a >> \discretionary node between each digit using some lua code. There are >> mostly likely better solutions for this. > >

Re: [NTG-context] how to hyphenate SHA512?

2017-07-08 Thread Hans Hagen
On 7/8/2017 10:20 AM, josephcan...@gmail.com wrote: If I am not mistaken SHA is only hexadecimal digits, so you probably need only to have a « language » that hyphenates between any pair of those. Should be much simpler I guess, but I do not really know how to add such setting I am afraid. you

Re: [NTG-context] how to hyphenate SHA512?

2017-07-08 Thread Hans Hagen
t; *Envoyé le :*jeudi 6 juillet 2017 12:00 *À : *mailing list for ConTeXt users <mailto:ntg-context@ntg.nl> *Objet :*[NTG-context] how to hyphenate SHA512? Dear list, I have the following sample: \starttext \hsize\zeropoint hyphenation 8b

Re: [NTG-context] how to hyphenate SHA512?

2017-07-08 Thread josephcanedo
juillet 2017 08:56 À : ntg-context@ntg.nl Objet :Re: [NTG-context] how to hyphenate SHA512? Many thanks for your reply, Joseph. The underscore I want to use should be placed below the previous character, such as in (code from Hans): \startluacode function document.addfunnyhyphen(tfmdata

Re: [NTG-context] how to hyphenate SHA512?

2017-07-08 Thread Pablo Rodriguez
le.concat(out, '\\discretionary{_}{}{}')) > end > > \stopluacode > > \starttext > > \hyphenation > > \ctxlua{sha([[8b2f3c087046c3943ace0dc4f958ef2138e58a51b40eef6fab6fa1aeb845cc257a410ab1b914bc399b4293f31c76fc2c73e5be5ea4d329f9e6820984688efec2]])} > > \stoptext > > > *De : *Pablo Rodriguez <mailto:oi...@gmx.es> > *En

Re: [NTG-context] how to hyphenate SHA512?

2017-07-07 Thread josephcanedo
([[8b2f3c087046c3943ace0dc4f958ef2138e58a51b40eef6fab6fa1aeb845cc257a410ab1b914bc399b4293f31c76fc2c73e5be5ea4d329f9e6820984688efec2]])} \stoptext De : Pablo Rodriguez Envoyé le :jeudi 6 juillet 2017 12:00 À : mailing list for ConTeXt users Objet :[NTG-context] how to hyphenate SHA512? Dear list, I have the following

[NTG-context] how to hyphenate SHA512?

2017-07-06 Thread Pablo Rodriguez
get the SHA512 string hyphenated in any of its points? Many thanks for your help, Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg