MD5 and SHA1 usage optimization