encode redis data