REBOL Document

Enbase - Function Summary


Summary:

Converts a string to a different base representation.

Usage:

enbase value

Arguments:

value - The string to encode (must be: any-string)

Refinements:

/base - Allow a selection of a different base for conversion

base-value - The base to convert to: 64, 16, or 2

Description:

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."
    SGVyZSBpcyBhIHN0cmluZy4=


    print enbase/base #{12abcd45} 16
    12ABCD45

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


    bin: enbase "This is a string"
    print debase bin
    #{54686973206973206120737472696E67}

Related:

debase - Converts a string from a different base representation to binary.
dehex - Converts URL-style hex encoded (%xx) strings.


<Back | Index | Next>

Copyright 2004 REBOL Technologies