You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
526 B

  1. #!/usr/bin/perl
  2. BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } }
  3. use misc qw(khash);
  4. use encode qw(mbase58 mbase36 mbase16);
  5. my $hash;
  6. $hash = &khash('MD5',undef);
  7. printf "md5: %s\n",mbase16($hash);
  8. $hash = &khash('SHA1',undef);
  9. printf "sha1: %s\n",mbase16($hash);
  10. $hash = &khash('SHA256',undef);
  11. printf "sha2: %s\n",mbase16($hash);
  12. $hash = &khash('SHA256','Hello World!');
  13. printf "kh58: %s\n",mbase58($hash);
  14. $hash = &khash('SHA3_224','Hello World!');
  15. printf "kh36: %s\n",mbase36($hash);
  16. exit $?;
  17. 1;