base.encode0.000001
Encodes a string to a base.
Arguments
baserequired
The base to encode to.safe
If true
, will encode the given string in a url-safe way.Return Value
The encoded string.something went wrong :(
Encoding a string to base64
Setup
authorization=PROCAUTH
require "proc"
client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.base.encode.call("hello", base: "64")
client.base.encode.call("hello", {base: "64"});
curl "https://proc.run/base/encode?base=64" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain" \
--data "hello"
aGVsbG8=
Supported Bases
64 |
RFC 2045 compliant base64 encoding. |
64U |
RFC 2045 compliant url-safe base64 encoding, without padding. |
Stuck? Want to chat about an idea? Join the community on Discord.