File : hashes.adb


   1 with GNAT.SHA256; use GNAT.SHA256;
   2 
   3 
   4 package body Hashes is
   5    
   6    function Sha256_Sum(S : Stream_Element_Array) return SHA256Hash is
   7       Ctx  : Context := Initial_Context;
   8       D : Binary_Message_Digest;
   9    begin
  10       Update(Ctx, S);
  11       D := Digest(Ctx);
  12       return SHA256Hash(D);
  13    end Sha256_Sum;
  14 
  15 end Hashes;