Floyd's cycle finding algorithm on SHA256 I'm trying to implement Floyd's cycle finding algorithm on SHA256 function. I think I understood the method used to find cycles but what bothers me is how to properly feed the repeated hashing function.
Let's say I hash string "abc".
What I will get as a result is :
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
As I understood this is a 256-bit (32-byte) output so it could be chunked as:
ba 78 16 bf 8f 01 cf ea 41 41 40 de 5d ae 22 23 b0 03 61 a3 96 17 7a 9c b4 10 ff 61 f2 00 15 ad where each chunk could be represented as individual character.

So my question is should I feed the next Hash function with the raw result with 32-byte or with the string:
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
which I suppose has 64-byte.


Additionally, if I were only to check first 4-bytes for the collision, what should be fed to the hashing function in this case?
We usually use raw bytes, because this doesn't require extra step (convert hex to string). But technically speaking any representation will allow you to find a cycle (just a different one).

When talking about shortened-hash cycles, same rules apply: we usually use raw bytes just cut to desired length or we fill rest of hash with zeros, because that requires least steps to complete. But you can use anything that will cut entropy to desired value.