aw schriftzug.png aw logo 60x60.png

internal package Foswiki::Plugins::LdapGuiPlugin::Hash

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

ClassMethod new()

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:
  • SHA
  • MD5
  • SSHA
  • SMD5
  • CRYPT

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.

Private method getSalt ($length) → $salt

Returns a salt value with the given length of bytes

Topic revision: r1 - 2018-02-27, UnknownUser
This site is powered by FoswikiCopyright &© by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Wiki? Send feedback