Perl SHA digest

Problem

You want to generate a SHA digest for a given string.



Solution

Perl has great encryption and digesting algorithms.

In the example tab we use the Digest Perl module.



Example



perl -M'Digest::SHA1 qw(sha1_hex)'
-e '$dig=sha1_hex("my big test"); print "$dign";'

419e6139a21f51a3f2ea1a783cfe536a0dada873



Reference

[tags]Perl SHA Digest, Perl, SHA, Encryption, Perl Coding School[/tags]



Leave a Reply

Your email address will not be published. Required fields are marked *