1 USING: help.markup help.syntax kernel math sequences ;
5 { $values { "seq" sequence } { "base64" "a string of base64 characters" } }
6 { $description "Converts a sequence to its base64 representation by taking six bits at a time as an index into a lookup table containing alphanumerics, '+', and '/'. The result is padded with '=' if the input was not a multiple of six bits." }
8 { $example "USING: prettyprint base64 strings ;" "\"The monorail is a free service.\" >base64 >string ." "\"VGhlIG1vbm9yYWlsIGlzIGEgZnJlZSBzZXJ2aWNlLg==\"" }
10 { $see-also base64> >base64-lines } ;
13 { $values { "seq" sequence } { "base64" "a string of base64 characters" } }
14 { $description "Converts a sequence to its base64 representation by taking six bits at a time as an index into a lookup table containing alphanumerics, '+', and '/'. The result is padded with '=' if the input was not a multiple of six bits. A crlf is inserted for every 76 characters of output." }
15 { $see-also base64> >base64-lines } ;
19 { $values { "base64" "a string of base64 characters" } { "seq" sequence } }
20 { $description "Converts a string in base64 encoding back into its binary representation." }
22 { $example "USING: prettyprint base64 strings ;" "\"VGhlIG1vbm9yYWlsIGlzIGEgZnJlZSBzZXJ2aWNlLg==\" base64> >string ." "\"The monorail is a free service.\"" }
24 { $notes "This word will throw if the input string contains characters other than those allowed in base64 encodings." }
25 { $see-also >base64 >base64-lines } ;
28 { $description "Reads the standard input and writes it to standard output encoded in base64." } ;
31 { $description "Reads the standard input and decodes it, writing to standard output." } ;
33 HELP: encode-base64-lines
34 { $description "Reads the standard input and writes it to standard output encoded in base64 with a crlf every 76 characters." } ;
36 ARTICLE: "base64" "Base 64 conversions"
37 "The " { $vocab-link "base64" } " vocabulary implements conversions of sequences to printable characters in base 64. These plain-text representations of binary data may be passed around and converted back to binary data later." $nl
38 "Converting to and from base64 as strings:"
44 "Using base64 from streams:"