Pure perl6 implementation of SHA-256 and RIPEMD-160 digests
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib use polymod in sha256 return line Nov 18, 2015
t increment VERSION and remove useless BEGIN in tests Sep 5, 2014
.travis.yml add travis file Oct 12, 2015
CREDITS
LICENSE
META6.json
README.md Don't use explosive encoding Jun 4, 2017
TODO updating TODO + increase minor version number Dec 4, 2012

README.md

This is a perl6 module implementing some digest algorithms in pure Perl6 (no parrot or nqp:: code).

The interface is minimal: functions only return Blob and only take a Blob as argument. It's up to the user to turn it into an hex string if they need to.

use Digest::SHA;
say my $sha256 = sha256 "hello".encode: 'utf8-c8';

use Digest::RIPEMD;
say rmd160 "bye".encode: 'utf8-c8';

sub buf_to_hex { [~] $^buf.list».fmt: "%02x" }
say buf_to_hex $sha256;

Currently implemented:

  • Digest
    • md5
  • Digest::SHA :
    • sha256
    • sha1
  • Digest::RIPEMD :
    • rmd160

This work is published under the terms of the artistic license, as rakudo is. See LICENSE file.