Encoding a .json file for a bytecode vm

65 views Asked by At

I'm trying to make a Bytecode VM in python just for fun, as a hobby project, but i have a problem, how i can encode a json file like this:

{
 "code": [["0xf2", "Hello"], ["0xf3", 1]],
 "constants": []
}

into some file format, something like encrypting, but in some way that it doesn't get so random, i need something more readable but encrypted at the same time.

1

There are 1 answers

0
Rafael de Bem On BEST ANSWER

Encoded files and human-readable files are not always compatible. However, I believe that BSON, an encoded JSON variant, is a good solution to your problem.