1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

Example of a better UTF8 to UTF16LE encoding in unit test. It allows digesting UTF8 encoded password candidates from the shell in passthrough mode

This commit is contained in:
Jens Steube 2021-05-01 12:22:07 +02:00
parent f8ea1d5e78
commit db6f93b159

View File

@ -9,7 +9,7 @@ use strict;
use warnings;
use Digest::MD4 qw (md4_hex);
use Encode;
use Text::Iconv;
sub module_constraints { [[0, 256], [-1, -1], [0, 27], [-1, -1], [-1, -1]] }
@ -17,7 +17,9 @@ sub module_generate_hash
{
my $word = shift;
my $digest = md4_hex (encode ('UTF-16LE', $word));
my $converter = Text::Iconv->new('utf8', 'UTF-16LE');
my $digest = md4_hex ($converter->convert ($word));
return $digest;
}