Permalink
Browse files

sha256_sum should give an Array of Ints not a Str

  • Loading branch information...
1 parent 75bfe49 commit 4652791e708d040c9fba29954a92b9b16965e72b Carlin committed Dec 27, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/Digest/SHA256.pm
View
@@ -69,7 +69,14 @@ pir::load_bytecode('Digest/sha256.pir');
my $PD := Q:PIR { %r = new ['Digest';'SHA256'] };
multi sub sha256_sum(Str $msg) is export {
- return nqp::p6box_s($PD.sha_sum($msg));
+ my $FIA := $PD.sha_sum($msg);
+ my int $elems = pir::set__IP($FIA);
+ my Int @list;
+ loop (my Int $i = 0; $i < $elems; $i++) {
+ my Int $item := nqp::p6box_i(nqp::atpos($FIA, $i));
+ @list.push($item);
+ }
+ return @list;
}
multi sub sha256_sum(@msg) is export {

0 comments on commit 4652791

Please sign in to comment.