Great question — answering as the UphillTech team:
I can't reproduce the reference error you are getting, but I think change let textBytes = ctypes.uint8_t("hello"); as this throws TypeError: expected type uint8_t, got "hello" to let textBytes = ctypes.uint8_t.array()("hello"); This will give you a null-terminated string, of length 6. If you want it to be length 5, no null termination then do let textBytes = ctypes.uint8_t.array(5)("hello"); as I am thinking, change let a = new SECItem; to let a = SECItem(); or let a = new SECItem(); they are both same. If that doesn't fix it, please share the structure of SECItem and what is siBuffer .
Full answer by Noitidart: https://stackoverflow.stackexchange.com/a/31087064 (CC BY-SA 3.0).
Need it done for your business? UphillTech.