anything
2021-1-20 11:55:12

Does the crypto package or any other implements the cryptographic hash function Keccak 256?


soegaard2
2021-1-20 13:03:47

Ryan will know - but I believe you can use (crypto-factories) to seea list. https://docs.racket-lang.org/crypto/factory.html?q=crypto


robby
2021-1-20 14:02:52

Yeah this is known. Sorry I have not found time to fix it yet. Hopefully tomorrow.


mflatt
2021-1-20 14:44:34

Done


mzuppichin
2021-1-20 16:33:32

@mzuppichin has joined the channel


hectometrocuadrado
2021-1-20 20:40:06

Im a bit confuse about c-structs in ffi. When using a constructor it returns a c-pointer to a struct. If I had to use a functoon that accepts a struct instead of a pointer, I just need to do ptr-ref on my c-pointer struct?


massung
2021-1-20 20:43:58

It should “just work”. For example, from my CSFML package:

(define-cstruct _sfVector2f ([x _float] [y _float])) (define-sfml sfSprite_setPosition (_fun _sfSprite* _sfVector2f -> _void)) I can just just do:

(sfSprite_setPosition (sprite) (make-sfVector2f x y)) And it “just works”


hectometrocuadrado
2021-1-20 20:46:45

Then, a c-struct in Racket works in both pointer and non-pointer arguments?


massung
2021-1-20 20:47:56

I believe so, and it just compiles to the right thing based on the type signature of the function.


massung
2021-1-20 20:48:07

If someone else knows better, though, I hope they chime in.


hectometrocuadrado
2021-1-20 20:55:22

Another question about ffi. I need to generate a pointer pointing to an “array” of objects of type A. That is, I need

A* val;

where val points to an “array” of As. How can I achieve this? Also, I would like to be able to use the constructor to inotialize every object A.


hectometrocuadrado
2021-1-20 20:59:23

The only solution I can think of is to use malloc to allocate the array, create each object A using its constructor and then copy each A into the array using memcpy.


mflatt
2021-1-20 21:01:03

Yes, that’s correct


mflatt
2021-1-20 21:02:32

Yes, that works. You can also use a ctype constructed with _array, but it amounts to the same thing and may not be convenient if the number of elements varies.


hectometrocuadrado
2021-1-20 21:12:34

Omg, thats awesome. I was doing castings everywhere


hectometrocuadrado
2021-1-20 21:13:19

Thanks!


ryanc
2021-1-20 21:17:36

No. The crypto package supports SHA3–256, but not KECCAK–256. I don’t think any of the underlying libraries (openssl, nettle, etc) support it.


bmitchell33
2021-1-21 05:28:53

Hello all. I am having trouble with the GUI toolkit. I have a pasteboard% in which I am embedding another pasteboard% as a snip using editor-snip%. I then try to display other snips (just regular snip% objects) inside the editor-snip%, but their draw method never fires. The get-extant method does get called, however. I can’t figure out if I am doing something wrong or not. The snip I am trying to display in the editor-snip% seems fine, because it displays as expected in the top-level pasteboard%. Edit: A code sample is attached below.


bmitchell33
2021-1-21 05:33:10

By “display other snips” I mean inserting them into the underlying editor of the editor-snip%.