SHA1 in Perl 6 using NativeCall
C Perl6 Makefile
Switch branches/tags
Nothing to show
Latest commit 4f6536c May 13, 2017 @bduggan committed on GitHub Merge pull request #5 from ugexe/patch-1
Remove unneccesary/undeclared dependencies
Permalink
Failed to load latest commit information.
lib/Digest/SHA1 Avoid use of removed method Apr 11, 2017
src Actually use SHA-1 implementation in library. Jan 9, 2017
t threads.t Oct 7, 2016
.gitignore init Oct 5, 2016
.travis.yml travis Oct 6, 2016
Build.pm Remove unneccesary/undeclared dependencies May 13, 2017
Configure.pl6 init Oct 5, 2016
LICENSE docs Oct 6, 2016
META6.json Bump version Apr 12, 2017
Makefile.in Fix Makefile to work on Windows. Jan 9, 2017
README.md readme Oct 6, 2016

README.md

Digest::SHA1::Native

Fast SHA1 computation using NativeCall to C.

Build Status

Synopsis

use Digest::SHA1::Native;

say sha1-hex("The quick brown fox jumps over the lazy dog");
say sha1-hex("The quick brown fox jumps over the lazy dog".encode);
say sha1("The quick brown fox jumps over the lazy dog")».fmt('%02x').join;
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12

Description

sha1-hex accepts a string or bytes (a Buf or Blob) and returns a hex string.

sha1 converts the hex into binary (i.e. it returns a Blob).

Examples

From https://en.wikipedia.org/wiki/Hash-based_message_authentication_code#Examples:

use Digest::HMAC;
use Digest::SHA1::Native;

say hmac-hex("key","The quick brown fox jumps over the lazy dog",&sha1);

de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9