Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use Digest::MD5 qw(md5_hex);
- use Term::ANSIColor;
- sub string_to_md5 {
- my $input_string = shift;
- my $md5_result = md5_hex($input_string);
- return $md5_result;
- }
- print color('bold yellow');
- print "Masukkan string yang ingin diubah ke MD5: ";
- print color('reset');
- my $user_input = <STDIN>;
- chomp($user_input);
- my $md5_result = string_to_md5($user_input);
- print color('bold blue');
- print "Nilai MD5 dari string '$user_input': $md5_result\n";
- print color('reset');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement