internal package
Foswiki::Plugins::LdapGuiPlugin::Hash Creates a new hash object.
usage:my $hasher = Package::Hash->new() my $hash = $hasher('I am the text', 'ssha');
$hash will contain the hashed value prepended by {SSHA}. (suitable for LDAP)
Supported algorithms:SMELL: As soon as possible this must become more portable, the way random bytes get generated should get changed.
ObjectMethod
getHash ($text, $algorithm) → $hash Takes text and the name of the algorithm which should be used and returns the hash prepended with the algorithm name. returns empty string on failure
ObjectMethod
addAlgorithm ($algorithmName, \&algorithm) → $hash Sets a new algorithm and name to be used.
Returns a salt value with the given length of bytes