Skip to content

Commit 1ff73f7

Browse files
committed
Added rockspec and some docs.
1 parent 39fa7b1 commit 1ff73f7

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# lua-resty-scrypt
22

3-
LuaJIT FFI-based scrypt library for OpenResty.
3+
`lua-resty-scrypt` is a scrypt (password) hashing library for OpenResty.
44

55
## Hello World with lua-resty-scrypt
66

@@ -13,6 +13,35 @@ local valid = scrypt.check("My Guess", hash) -- valid holds false
1313
local n,r,p = scrypt.calibrate() -- returns n,r,p calibration values
1414
```
1515

16+
## Installation
17+
18+
Just place [`scrypt.lua`](https://github.com/bungle/lua-resty-scrypt/blob/master/lib/resty/scrypt.lua) somewhere in your `package.path`, preferably under `resty` directory. If you are using OpenResty, the default location would be `/usr/local/openresty/lualib/resty`.
19+
20+
### Compiling and Installing Scrypt C-library
21+
22+
These are just rudimentary notes. Better installation instructions will follow:
23+
24+
1. First download Scrypt from here: https://github.com/bungle/lua-scrypt
25+
2. Run `make`
26+
4. Place `scrypt.so` in Lua's `package.cpath` (or modify `scrypt.lua` and point `ffi_load("scrypt")` with full path to `scrypt.so`, e.g. `local json = ffi_load("/usr/local/lib/lua/5.1/scrypt.so")`).
27+
28+
### Using LuaRocks or MoonRocks
29+
30+
If you are using LuaRocks >= 2.2:
31+
32+
```Shell
33+
$ luarocks install lua-resty-scrypt
34+
```
35+
36+
If you are using LuaRocks < 2.2:
37+
38+
```Shell
39+
$ luarocks install --server=http://rocks.moonscript.org moonrocks
40+
$ moonrocks install lua-resty-scrypt
41+
```
42+
43+
MoonRocks repository for `lua-resty-scrypt` is located here: https://rocks.moonscript.org/modules/bungle/lua-resty-scrypt.
44+
1645
## Lua API
1746

1847
#### string scrypt.crypt(opts)

lua-resty-scrypt-dev-1.rockspec

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package = "lua-resty-scrypt"
2+
version = "dev-1"
3+
source = {
4+
url = "git://github.com/bungle/lua-resty-scrypt.git"
5+
}
6+
description = {
7+
summary = "LuaJIT FFI-based scrypt library for OpenResty.",
8+
detailed = "lua-resty-scrypt is a scrypt (password) hashing library for OpenResty.",
9+
homepage = "https://github.com/bungle/lua-resty-scrypt",
10+
maintainer = "Aapo Talvensaari <[email protected]>",
11+
license = "BSD"
12+
}
13+
dependencies = {
14+
"lua >= 5.1"
15+
}
16+
build = {
17+
type = "builtin",
18+
modules = {
19+
["resty.scrypt"] = "lib/resty/scrypt.lua"
20+
}
21+
}

0 commit comments

Comments
 (0)