How to read messege.data in match loop?

hi.

im using typescript and in matchLoop function i want to convert players inputs(messeges data) arraybuffer to json(string) to manage players inputs and store or validate them..

these attempt not working..
for (const message of messages) {

1- nk.binaryToString(message.data) return a string but i can’t convert it to json

2- nk.base64Encode(message.data) return encoded string but i cant convert it to json( this maybe must be encode by aes 128/256 i dont know how decypted! because the encryption key must get byte fixed.

3- also i dont want to create class or interface based on user inputs. i want just an json string is that possible?
}

Server version: 3.19.0+7d5051fb

turns out c# client was sending bytes using System.Text.Encoding.Unicode.GetBytes(data).
parsing the Unicode it was the problem and it caused the error on Json.parse() in typescript..
so we changed it to System.Text.Encoding.ASCII and problem was solved.