getCk and toHexStr
refactor toHexStr