Changeset 14251 in project


Ignore:
Timestamp:
04/15/09 00:43:24 (11 years ago)
Author:
Jim Ursetto
Message:

Changes applied for zbigniew (71.201.84.72) through svnwiki:

base64: document base64-line-breaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/base64

    r14248 r14251  
    88== Documentation
    99
    10  '''procedure:''' (base64-encode STRING)
     10<procedure>(base64-encode STRING)</procedure>
    1111
    1212Returns {{STRING}} encoded as base64 text (a string).
    1313
    14  '''procedure:''' (base64-decode STRING)
     14<procedure>(base64-decode STRING)</procedure>
    1515
    16 Returns the decoded string from the base64 data {{STRING}}.
     16Returns the decoded string from the base64 data {{STRING}}.  Invalid input data is silently skipped.
     17
     18<parameter>(base64-line-breaks BOOLEAN) [default: #f]</parameter>
     19
     20If {{#t}}, the decoder inserts a CRLF into the output string every 76 output characters (57 input characters).  A CRLF will also be appended to the final line, only if it was a partial one (between 1 and 75 output characters).
    1721
    1822== Examples
     
    3640</result>
    3741</example></examples>
     42
     43A script that encodes a file given on the command-line in the style of {{uuencode -m}}:
     44
     45 #!/usr/local/bin/csi -script
     46 (use base64)
     47 (base64-line-breaks #t)
     48 
     49 (display
     50  (base64-encode
     51   (call-with-input-file (car (command-line-arguments))
     52     (lambda (p) (read-string #f p)))))
     53
    3854
    3955== About this egg
Note: See TracChangeset for help on using the changeset viewer.