To distinguish the randomness and chaos characteristics of physiological signals and to keep its performance independent of the signal length and parameters are the key judgement of performance of a complexity algorithm. We proposed an encoding Lempel-Ziv (LZ) complexity algorithm to try to explicitly discern between the randomness and chaos characteristics of signals. Our study also compared the effects of length of time series, the sensitivity to dynamical properties change of time series and quantifying the complexity between gauss noise and 1/f pink noise ELZ with those from classic LZ (CLZ), multi-state LZ (MLZ), sample entropy (SampEn) and permutation entropy (PE). The experimental results showed ELZ could not only distinguish the randomness and chaos characteristics of time series on all time length (i.e. 100, 500, 5 000), but also reflected exactly that the complexity of gauss noise was lower than that of pink noise, and responded change of dynamic characteristics of time series in time. The congestive heart failure (CHF) RR Interval database and the normal sinus rhythm (NSR) RR Interval database created by Massachusetts Institute of Technology (MIT) and Boston Beth Israel Hospital(BIH)were used as real data in our study. The results revealed that the ELZ could show the complexity of congestive heart failure which was lower than that of normal sinus rhythm during all lengths of time series (P<0.01), and the ELZ algorithm had better generalization ability and was independent of length of time series.