fixed resize function call - now works properly
fixed hash detection function increasing buffer position