-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 050bf21
Showing
103 changed files
with
16,580 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Editors + git | ||
.idea | ||
.git | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: ci-cd | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
ad: | ||
uses: sku4/ad-run/.github/workflows/ad.yml@master | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Editors | ||
.idea | ||
|
||
# Binaries for programs and plugins | ||
.bin | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
db | ||
*.out | ||
*.db | ||
*.lock | ||
*.har | ||
.env | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
data/ | ||
|
||
# Go workspace file | ||
go.work | ||
|
||
# Project | ||
.database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package = "ad-tnt" | ||
version = "scm-3" | ||
source = { | ||
url = "git+ssh://git@github.com:sku4/ad-tnt.git", | ||
} | ||
description = { | ||
homepage = "https://github.com/sku4/ad-tnt", | ||
license = "Proprietary", | ||
} | ||
dependencies = { | ||
"kit scm-2", | ||
"config scm-5", | ||
"package-reload scm-1", | ||
"spacer scm-3", | ||
"moonwalker scm-1", | ||
"net-graphite", | ||
"ctx", | ||
"queue scm-1", | ||
"xqueue scm-5", | ||
-- "crud scm-1", | ||
} | ||
build = { | ||
type = "builtin", | ||
modules = { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
rocks_servers = { | ||
"http://moonlibs.github.io/rocks", -- moonlibs libs | ||
"http://rocks.tarantool.org/", -- tarantool libs | ||
"http://luarocks.org/repositories/rocks", -- luarocks | ||
"https://rocks.moonscript.org", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
local ffi = require 'ffi' | ||
-- local uuid = require 'uuid' | ||
|
||
local libpath = package.search and package.search('libbase58') | ||
or assert(package.searchpath('libbase58', package.cpath)) | ||
local lib = ffi.load(libpath, true) | ||
local GENBUF = 256 | ||
|
||
local genbuf = ffi.new('char[?]',GENBUF) | ||
local sz = ffi.new('size_t [1]'); | ||
|
||
ffi.cdef[[ | ||
bool encode_base58(const char *data, size_t binsz, char *b58, size_t *b58sz); | ||
bool decode_base58(const char *b58, size_t b58sz, void *bin, size_t *binszp); | ||
char * strerror(int errnum); | ||
]] | ||
|
||
local function encode_base58( input ) | ||
local newsize = math.floor(#input*3/2)+1 | ||
-- print("newsize = ",newsize) | ||
local out | ||
if newsize > GENBUF then | ||
out = ffi.new('char[?]',newsize) | ||
sz[0] = newsize | ||
else | ||
out = genbuf | ||
sz[0] = GENBUF | ||
end | ||
-- local sz = | ||
-- sz[0] = ffi.sizeof(out) | ||
|
||
if lib.encode_base58(input, #input, out, sz) then | ||
if sz[0] > 0 then | ||
return ffi.string(out, sz[0]) | ||
else | ||
return "" | ||
end | ||
else | ||
error("Failed to encode", 2) | ||
end | ||
end | ||
|
||
local function decode_base58( input ) | ||
local newsize = math.floor(#input*4/3+1) | ||
-- print("newsize = ",newsize) | ||
local out | ||
if newsize > GENBUF then | ||
out = ffi.new('char[?]',newsize) | ||
sz[0] = newsize | ||
else | ||
out = genbuf | ||
sz[0] = GENBUF | ||
end | ||
if lib.decode_base58(input, #input, out, sz) then | ||
if sz[0] > 0 then | ||
return ffi.string(out+ffi.sizeof(out)-sz[0], sz[0]) | ||
else | ||
return "" | ||
end | ||
else | ||
error("Failed to decode: "..ffi.string(ffi.C.strerror(ffi.errno())), 2) | ||
end | ||
end | ||
|
||
-- print("e = ", encode_base58("09")) | ||
-- print("d = ", decode_base58("4ER")) | ||
-- print("e/d = ",encode_base58(decode_base58("4ER"))) | ||
|
||
local function hex2bin(str) | ||
return (string.gsub(str, '..', function (cc) return string.char(tonumber(cc, 16)) end)) | ||
end | ||
local function bin2hex(str) | ||
return (string.gsub(str, '.', function (c) return string.format('%02x', string.byte(c)) end)) | ||
end | ||
|
||
-- local v = "nsEZ97iJrza4gy3mk9AS55" | ||
-- -- local v = "nsss" | ||
-- print(v) | ||
-- print(bin2hex(decode_base58(v))) | ||
-- print( encode_base58(decode_base58(v)) ) | ||
-- print( "min", encode_base58("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00") ) | ||
-- print( "max", encode_base58("\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff") ) | ||
-- print( "min", #decode_base58( encode_base58("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")) ) | ||
-- print( "max", #decode_base58( encode_base58("\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff")) ) | ||
-- -- error("X") | ||
|
||
return { | ||
encode = encode_base58; | ||
decode = decode_base58; | ||
} | ||
|
Oops, something went wrong.