check crypt() for null. noticed by Jonas Termansen
introduce a hashspace define and check that there's enough space to
write out a hash. also simplify writing out the hash.