encoder: replace long with UInt