[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

[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

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] 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