removed ->getSalt() and ->getLength() out of closure, because of PHP 5.3 compatibility.