REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: enbase

enbase  value  /base  base-value

Encodes a string into a binary-coded string (BASE-64 default).


value [binary! string!] - If string, will be UTF8 encoded


/base - Binary base to use

base-value [integer!] - The base to convert to: 64, 16, or 2

See also:

debase   dehex  


Converts from a string or binary into an encode string value. Primarily used for BASE-64 encoding.

The /base refinement allows selection of base as 64, 16, 2. Default is base64.

print enbase "Here is a string."
print enbase/base #{12abcd45} 16

The debase function is used to convert the binary back again. For example:

bin: enbase "This is a string"
print debase bin

  TOC < Back Next > - WIP Wiki Feedback Admin