Skip to content

mah0x211/lua-base64mix

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 

lua-base64mix

base64 encode/decode module


Installation

luarocks install base64mix --from=http://mah0x211.github.io/rocks/

API

Encode

str, err = base64mix.encode( src:string )

local base64mix = require('base64mix');
local src = 'hello world';
local enc, err = base64mix.encode( src );
print( enc ); -- 'aGVsbG8gd29ybGQ='

str, err = base64mix.encodeURL( src:string )

this function will encode an argument to the base64url format.

Decode

str, err = base64mix.decode( src:string )

local base64mix = require('base64mix');
local src = 'aGVsbG8gd29ybGQ=';
local dec, err = base64mix.decode( src );
print( dec ); -- 'hello world'

str, err = base64mix.decodeURL( src:string )

this function will decode the base64url format string.

str, err = base64mix.decodeMix( src:string )

this function will decode the standard base64 and base64url format string.

About

base64 encode/decode module

Resources

Stars

Watchers

Forks

Packages

No packages published