your hash was 127 characters instead of 128. Replace 32 with 128 in the while loop Recommended Solve DSA problems on GfG Practice. Solve Problems