base64 - base64-encode/decode binary data
TABLE OF CONTENTS
SYNOPSIS
DESCRIPTION
EXAMPLES
KEYWORDS
COPYRIGHT
package require Tcl 8
package require base64 ?2.3.2?
|
This package provides procedures to encode binary data into base64 and back.
% base64::encode "Hello, world" SGVsbG8sIHdvcmxk |
% base64::encode [string repeat xyz 20] eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6 eHl6eHl6eHl6 % base64::encode -wrapchar "" [string repeat xyz 20] eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6eHl6 |
# NOTE: base64 encodes BINARY strings. % set chemical [encoding convertto utf-8 "C\u2088H\u2081\u2080N\u2084O\u2082"] % set encoded [base64::encode $chemical] Q+KCiEjigoHigoBO4oKET+KCgg== % set caffeine [encoding convertfrom utf-8 [base64::decode $encoded]] |
base64, encoding
Copyright © 2000, Eric Melski
Copyright © 2001, Miguel Sofer