optional maxLen parameter in prettyPrint
correct hash generation