Skip to content

Instantly share code, notes, and snippets.

Ugorji Nwoke ugorji

View GitHub Profile
ugorji / settings.gradle
Last active May 6, 2019
settings.gradle file for my multi-project gradle repositories
View settings.gradle
include ':java-common',
View github_go_codec_107.go
package github_107
import (
View gist:8bb851bf49cff1c3d4d9
package main
import (
func main() {
ugorji /
Last active Mar 5, 2018
MsgPack: Support timestamp as new spec-defined inter-operable extension type

Timestamp is a data type that represents an instant in time and space. It is supported by most programming languages. However, it is not defined in the msgpack spec. The lack of built-in support for timestamp is a constant issue brought up while evaluating encodings.

The proposal is to include timestamp support in the new spec as an inter-operable extension type, defined by the spec along with Binary. It will have extension tag -2.

A timestamp is composed of 3 components:

  • secs: signed integer representing seconds since unix epoch
  • nsces: unsigned integer representing fractional seconds as a nanosecond offset within secs, in the range 0 <= nsecs < 1e9
  • tz: signed integer representing timezone offset in minutes east of UTC, and a dst (daylight savings time) flag
ugorji /
Last active Dec 14, 2015

My thinking is summarized as :

There is old data already stored with the Raw ambiguity. In lieu of having all old data be re-written, the solution is to keep that ambiguity and add new explicit types.

Any old code that comes in touch with newly serialized data will break, and will have to update their libraries.

However, the old serialized data will not need to change or have its interpretation change, regardless of assumption made on how to handle Raw previously.

Beyond that, we add new native type for Timestamp and PrivateExtensions.

You can’t perform that action at this time.