convert buffer to scalar via FFI::Util