Advertisement
paperline27

String to MD5

Jan 21st, 2024
1,614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.53 KB | Source Code | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Digest::MD5 qw(md5_hex);
  5. use Term::ANSIColor;
  6.  
  7. sub string_to_md5 {
  8.     my $input_string = shift;
  9.     my $md5_result = md5_hex($input_string);
  10.     return $md5_result;
  11. }
  12.  
  13. print color('bold yellow');
  14. print "Masukkan string yang ingin diubah ke MD5: ";
  15. print color('reset');
  16. my $user_input = <STDIN>;
  17. chomp($user_input);
  18.  
  19. my $md5_result = string_to_md5($user_input);
  20.  
  21. print color('bold blue');
  22. print "Nilai MD5 dari string '$user_input': $md5_result\n";
  23. print color('reset');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement