Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /smlnj-lib/trunk/Util/base64-sig.sml
ViewVC logotype

Annotation of /smlnj-lib/trunk/Util/base64-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3761 - (view) (download)

1 : jhr 3742 (* base64-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 2012 The Fellowship of SML/NJ (http://www.smlnj.org)
4 :     * All rights reserved.
5 :     *
6 :     * Support for Base64 encoding/decoding as specified by RFC 4648.
7 :     *
8 :     * http://www.ietf.org/rfc/rfc4648.txt
9 :     *)
10 :    
11 :     signature BASE64 =
12 :     sig
13 :    
14 : jhr 3761 (* return true if a character is in the base64 alphabet *)
15 :     val isBase64 : char -> bool
16 : jhr 3742
17 : jhr 3761 val encode : Word8Vector.vector -> string
18 :     val encodeSlice : Word8VectorSlice.slice -> string
19 :    
20 :     (* raised if a Base64 string does not end in a complete encoding quantum (i.e., 4
21 :     * characters including padding characters).
22 :     *)
23 :     exception Incomplete
24 :    
25 :     (* raised if an invalid Base64 character is encountered during decode. The int
26 :     * is the position of the character and the char is the invalid character.
27 :     *)
28 :     exception Invalid of (int * char)
29 :    
30 :     (* decode functions that ignore whitespace *)
31 :     val decode : string -> Word8Vector.vector
32 :     val decodeSlice : substring -> Word8Vector.vector
33 :    
34 :     (* strict decode functions that only accept the base64 characters *)
35 :     val decodeStrict : string -> Word8Vector.vector
36 :     val decodeSliceStrict : substring -> Word8Vector.vector
37 :    
38 : jhr 3742 end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0