Skip to content

Instantly share code, notes, and snippets.

let rec encode (o:obj) =
let x = ofObject o in
let b = toBytes x in
let length = List.length b in
let lenghtInByte = List.head (toBytes (Int length)) in
let lenghtOfLenghtBinaryFormInByte = List.head (toBytes(Int(String.length (intToBinary length)))) in
match x with
| String s ->
match length with
| 0 -> [0x80uy]
{
"content": [
{
"id": 10017,
"location": {
"id": 10017,
"country": "GB",
"region": "London",
"city": "London",
"postCode": "SW20 0RW",
{
"content": [
{
"id": 10017,
"location": {
"id": 10017,
"country": "GB",
"region": "London",
"city": "London",
"postCode": "SW20 0RW",