I put in redis a key-value, where key is UUID converted to a byte array, for space optimization.
"3DEBB752-654A-4206-89BA-D3517237312E" -> [-119, -70, -45, 81, 114, 55, 49, 46, 61, -21, -73, 82, 101, 74, 66, 6].
I'm using Spring Jedis to get data from Redis server and when I try to get key via KEYS
function
jedisConnection.keys("*".getBytes());
I get
[-119, -70, -45, 81, 114, 55, 49, 46, 61, -21, -73, 82, 101, 74, 66, 6]
But, when I try to fetch keys via SCAN function
jedisConnection.scan(ScanOptions.NONE);
key somehow change to this
[-17, -65, -67, -17, -65, -67, -17, -65, -67, 81, 114, 55, 49, 46, 61, -17, -65, -67, 82, 101, 74, 66, 6]
I'm confused, please tell me why are the keys different for KEYS
and SCAN