UTCode

UTCode is a simple way to have a serialization with types and custom objects.

A simple example

{
  "name": "Umgeher Torgersen",
  "phone:" {
	"mobile": "+00123123123",
	"work": "+00321321312"
  },
  "tags": ["freebsd", "erlang", "viking"],
  "active": true,
  "id": 1337,
  "none_example": none
}

Turns to:

ut:d:k6:activeb:1k2:idi:1337ek4:nameu24:VW1nZWhlciBUb3JnZXJzZW4=k12:none_examplen:ek5:phoned:k6:mobileu16:KzAwMTIzMTIzMTIzk4:worku16:KzAwMzIxMzIxMzIxek4:tagsl:u12:ZnJlZWJzZA==u8:ZXJsYW5nu8:dmlraW5nee

Custom Objects

With Custom Object Types you can create your cross plataform object serialization without any hard work. Just expand UTCode with your custom objects types. The only recomendation is to use a uppercase char to custom types.

A simple and nice example is a custom object type that I use is an image type.

ut:I:pR0lGODlhyADIAMQAAJQCAtG0tGwEBKdzc/8AALWJif///5FKSunc3NrDw/9jY/nn5+PNzf+Li/6qqv3Hx+7k5PvY2L8AAP8yMv8UFH8pKZ9jY/n29sKgoPXv7+UAAPz6+mQAAPn5+f78/Pv+/iH5BAAAAAAALAAAAADIAMgAAAX/oCGOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/otHrNbrvf8Lh8Tq/b7/i8fs/v+/+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKzRgkJMgy3tDwJAgEyARwFuzoQFRy/BhkICQEYz9ABDAsjGAICGMQ4BwACBwMVFQIc5NfX5BwCFRYBFgASAgjaNQwcGgDp7xIa/AT+BPw0SOhGbp8AC/NmBBAnYd+/hxAhCmzYLUNCGAM4ANAQsaNHfwM5DPBwsUUBDhI+/6r0KIGDhQ0lVdRLubKmRJcxU1gQYLPnw5bZcpbIIICmz54arlkUOiIYx6M+8QWdF2AAhqUiCvCE6rPlgYsXtAIo0EHEAAARk6LlChFeBZIXEwAAcKCsu7RFkQpY21Yd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vvmfLFHGp2XiZq4iZzYiZ74iaAYiqI4iqRYiqZ4iqiYiqq4iqzYijiu+IqwGIuyOIu0WIu2eIu4mIu6uIu82Iu++IvAGIzCOIzEWIzGeIzImIzKuIzM2IzO+IzQ6IkhAAA7|

The first char is the image type, in this case PNG, follow by the image content, until the | char.

Another example is my “ Contact Type “.

ut:C:p|VW1nZWhlciBUb3JnZXJzZW4=|bWVAdW1nZWhlci5vcmc=|dW1nZWhlcg==|

I use | to split the content. First p says it’s a Person contact. The 2nd is the name, 3rd email and the last is the alias/nickname.

Libs…