https://github.com/leafo/lua-base58
base58 decode and encode for strings in pure lua
https://github.com/leafo/lua-base58
lapis lua luajit moonscript
Last synced: 11 days ago
JSON representation
base58 decode and encode for strings in pure lua
- Host: GitHub
- URL: https://github.com/leafo/lua-base58
- Owner: leafo
- License: mit
- Created: 2015-02-13T06:42:41.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-03T20:04:36.000Z (almost 4 years ago)
- Last Synced: 2025-05-12T20:25:18.108Z (11 days ago)
- Topics: lapis, lua, luajit, moonscript
- Language: MoonScript
- Homepage:
- Size: 10.7 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base58
A Lua module for converting strings to
[base58](http://en.wikipedia.org/wiki/Base58). It works by converting your
string into an interal big integer representation, then diving out the base58
components.## Example
```lua
local base58 = require("base58")
print(base58.encode_base58("Hello world"))
print(base58.decode_base58("TvjnTzXAiTprExJ"))
```## Install
```
luarocks install base58
```# Reference
All functions are available in the `base58` module:
```lua
local base58 = require("base58")
```The following alphabet is included and used by default. It's currently not
possible to configure the alphabet without editing the source.```
rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz
```#### `encode_base58(string)`
Encodes the string into base58
#### `decode_base58(string)`
Decodes base58 back into original string. If the input passed in contains
invalid characters `nil` and an error message are returned.# Contact
Author: Leaf Corcoran (leafo) ([@moonscript](http://twitter.com/moonscript))
Email: [email protected]
Homepage:
License: MIT