Re: [Jprogramming] HMAC

2017-12-22 Thread bill lam
see http://code.jsoftware.com/wiki/System/ReleaseNotes/J806 SHA1 was also implemented using pure J script. On Dec 23, 2017 12:15 AM, "Danil Osipchuk" wrote: > Actually presence of 128!:6 is (good) news - it certainly was not there, > thank you Bill (difficult to tell apart memory and imaginati

Re: [Jprogramming] AoC 13

2017-12-22 Thread Raul Miller
timespacex 'safe s13' 3.16326 1.03136e7 Thanks, -- Raul On Fri, Dec 22, 2017 at 1:52 PM, 'Mike Day' via Programming wrote: > How long did pt 2 take for you? I found something else do do, while I let > J loop on trial delays, but it was several minutes, I think > > Mike > > Please rep

Re: [Jprogramming] AoC 13

2017-12-22 Thread 'Mike Day' via Programming
How long did pt 2 take for you? I found something else do do, while I let J loop on trial delays, but it was several minutes, I think Mike Please reply to mike_liz@tiscali.co.uk. Sent from my iPad > On 22 Dec 2017, at 18:37, Raul Miller wrote: > > For what it's worth, here's wh

Re: [Jprogramming] AoC 13

2017-12-22 Thread Raul Miller
For what it's worth, here's what I did for day 13. s0 is the sample data set. s0=:|:".;._2]0 :0-.':' 0: 3 1: 2 4: 4 6: 4 ) ride=:*/ +/ .* 0 = (|~ _2 2&p.)/ safe=:3 :0 'when len'=: y dur=. _2 2&p.len lim=. *./dur NB. delays=: i.*./dur bs=. >./ (* 1e5&>) */\q:lim for_block. bs*i.lim%bs d

Re: [Jprogramming] AoC 13

2017-12-22 Thread 'mike_liz....@tiscali.co.uk' via Programming
That problem took a lot of reading! Like you, Brian, I started with the boustrophedon cycles: example NB. my data has 2 rows: depth,: range: 0 1 4 6 3 2 4 4 (Brian forms the data into a simple vector of ranges 3 2 0 0 4 0 4 ) My verb, cycle, is used to assemble a look-up table of scan po

Re: [Jprogramming] sparse negative take

2017-12-22 Thread Brian Schott
Linda, (and thanks to others who helped before you, too) Thanks very much for that reference and for the information about how to access it from the Vocabulary page. That is awesome. I had a little trouble at first finding "LJ" on the Vocabulary page, because I had not noticed it before at the to

Re: [Jprogramming] HMAC

2017-12-22 Thread Danil Osipchuk
Actually presence of 128!:6 is (good) news - it certainly was not there, thank you Bill (difficult to tell apart memory and imagination when getting older ). MD5 while being not recommended, I'm sure will be missed. As a side note: a somewhat neater version with ^: 'if idiom' hmac =: 2 : 0 NB. m

Re: [Jprogramming] HMAC

2017-12-22 Thread Raul Miller
It can be difficult for anyone to come back and read code a while later. That's one of the reasons why we keep replacing old systems (usually with something less efficient). But this can also be seen as an opportunity to develop skills at documentation: Wait long enough that it starts being diffic

Re: [Jprogramming] HMAC

2017-12-22 Thread Danil Osipchuk
Below, is a generalization conjunction hmac for what is available in 128!:6, tests are for sha1, to check correctness wtr of alg/padding, m - is a key string n - the same meaning as on 128!:6 bfh=:a.{~_2(16&#.)\'0123456789abcdef'i.] NB. bytes from hex string 'key' hmac 1 'asdf' 384d71757bad0ee7

Re: [Jprogramming] HMAC

2017-12-22 Thread Danil Osipchuk
I know, but I had to use md5 - I remember wondering why it is not there. The same issue had the person writing jqt where I borrowed md5 2017-12-22 13:16 GMT+03:00 bill lam : > j806 j engine supports various sha, both hex and byte output. > > On Dec 22, 2017 4:51 PM, "Danil Osipchuk" > wrote:

Re: [Jprogramming] HMAC

2017-12-22 Thread bill lam
j806 j engine supports various sha, both hex and byte output. On Dec 22, 2017 4:51 PM, "Danil Osipchuk" wrote: > Below is a snippet I used to sign files with md5hmac, may be of some use. > (I envy people easily reading other's J, I have difficulties reading mine a > while later ) > regards, >

Re: [Jprogramming] HMAC

2017-12-22 Thread Danil Osipchuk
Below is a snippet I used to sign files with md5hmac, may be of some use. (I envy people easily reading other's J, I have difficulties reading mine a while later ) regards, Danil qthash =: 4 : 0NB. taken from qt ide, x is hash algo name str, y is a data string, result is