Leser: 18
"Hello World\0How are you today?\0Perl is cool!\0"
awk -F '\0' '{printf("%s\0%s\0",$1,md5sum($1))}' file > output
1
2
tr '\0' '\n' < file |
perl -MDigest::MD5=md5_hex -lpe '$_ = sprintf("%s\n%s",$_,md5_hex $_)'
perl -MDigest::MD5=md5_hex -F'\0' -le 'printf("%s\0%s\0",$_,md5_hex $_)' < file > output
"Hello World\0b10a8db164e0754105b7a99be72e3fe5\0How are you today?\0eb7edd81af9146ea0ef9c9397ece0bc4Perl is cool!\082a8f26caedfc4c7586abd24c577908f\0"
2010-10-25T12:50:14 hollandhasserWie lese/iteriere ich das File Zero-Byte separiert
perl -MDigest::MD5=md5_hex -e '$/="\0"; while(<>){chomp; print "$_\0".md5_hex($_)."\0"}' in.file > out.file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/usr/bin/perl use strict; use warnings; use Digest::MD5 qw(md5_hex); my @content; { open my $fh, '<', 'null_byte.txt' or die $!; local $/ = "\0"; while ( my $entry = <$fh> ) { push @content, $entry, md5_hex( $entry ); } close $fh; } open my $fh, '>', 'null_byte_new.txt' or die $!; print $fh join "\0", @content; close $fh;