[html-formfu] Password hash gives different results each time

Ascii King tech at swattermatter.com
Thu Apr 30 19:24:05 GMT 2009


I have a password field that I am trying to encrypt using some code 
provided by David Schmidt. It seems to work, except that it returns a 
different value each time, even if the passwords are the same.

Is this because it is operatijg on the object or the hash and not the 
value? Here is my code.

--------------------------------
lib/OMTSWeb/Controller/Digest_SHA.pm
--------------------------------
package OMTSWeb::Controller::Digest_SHA;
use strict;
use warnings;
use base 'HTML::FormFu::Filter';
use Digest::SHA qw/sha1_hex/;

sub hashit {
    my ( $self, $value, $params ) = @_;
    return sha1_hex($value);
}

1;

--------------------------------
request_account.yml
--------------------------------
   - type: Password
     name: password
     label: Password
     constraints:
       - type: Length
         min: 6
         max: 50
         message: Length must be between 6 and 50 characters
     transformers:
       - type: Callback
         callback: OMTSWeb::Controller::Digest_SHA::hashit





More information about the HTML-FormFu mailing list