does anyone know how this can be accomplished in javascript? i’ve searched all over the internet and there’s no clear answer. Please help!!
I’ve used the following function, but it doesn’t work properly since I need the actual binary string representation (not 0 1s but just the original data):
byte[] = Encoding.ASCII.GetBytes(String);
I’m not expert for Java but as I now Java is similar to C# an C++.
I found one example which I thing can solve your problem :
var javaString = new java.lang.String("Hello world!");
var byteArray = javaString.getBytes();
byteArray[0] // returns 72
byteArray[1] // returns 101
I figured it out. it was caused by something else. I’m trying to write a backend server.