File: sha-strings.ads

package info (click to toggle)
libaws 2.2dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,624 kB
  • ctags: 1,173
  • sloc: ada: 61,829; ansic: 6,483; makefile: 1,282; xml: 196; sh: 119; java: 112; python: 66; sed: 40
file content (17 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--  (C) Copyright 2000 by John Halleck, All Rights Reserved.
--  Convert SHA digests to printable strings.

package SHA.Strings is
   pragma Pure (SHA.Strings);

   --  Standard (Uppercase) Hex.
   type Hex_SHA_String is new String (1 .. (Bits_In_Digest / 8) * 2);

   --  Network Base 64 encoding. (See the Mime standard)
   type B64_SHA_String is new String (1 .. ((Bits_In_Digest / 8) + 2) / 3 * 4);

   --  And the routines to fill in the above.
   function Hex_From_SHA (Given : Digest) return Hex_SHA_String;
   function B64_From_SHA (Given : Digest) return B64_SHA_String;

end SHA.Strings;