{"id":27938911,"url":"https://github.com/xiyoo0812/lcrypt","last_synced_at":"2025-05-07T08:58:26.092Z","repository":{"id":137454384,"uuid":"380227990","full_name":"xiyoo0812/lcrypt","owner":"xiyoo0812","description":"提供给lua使用的集成加密和压缩库集合！","archived":false,"fork":false,"pushed_at":"2024-03-30T04:14:16.000Z","size":137,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T08:58:20.765Z","etag":null,"topics":["base64","des","lua","md5","sha"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiyoo0812.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-06-25T12:15:40.000Z","updated_at":"2024-07-31T22:52:06.000Z","dependencies_parsed_at":"2024-03-30T05:23:20.344Z","dependency_job_id":"88092dd4-0cb3-4ef9-8ed2-f0e18d97c9b7","html_url":"https://github.com/xiyoo0812/lcrypt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Flcrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Flcrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Flcrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Flcrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiyoo0812","download_url":"https://codeload.github.com/xiyoo0812/lcrypt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847510,"owners_count":21813451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["base64","des","lua","md5","sha"],"created_at":"2025-05-07T08:58:25.405Z","updated_at":"2025-05-07T08:58:26.085Z","avatar_url":"https://github.com/xiyoo0812.png","language":"C","readme":"# lcrypt\n提供给lua使用的集成加密和压缩库集合！\n\n# 依赖\n- [lua](https://github.com/xiyoo0812/lua.git)5.2以上\n- 项目路径如下\u003cbr\u003e\n  |--proj \u003cbr\u003e\n  \u0026emsp;|--lua \u003cbr\u003e\n  \u0026emsp;|--lcrypt\n\n# 编译\n- msvc: 准备好lua依赖库并放到指定位置，将proj文件加到sln后编译。\n- linux: 准备好lua依赖库并放到指定位置，执行make -f lcrypt.mak\n\n# 注意事项\n- mimalloc: 参考[quanta](https://github.com/xiyoo0812/quanta.git)使用，不用则在工程文件中注释\n\n# 用法\n```lua\n--crypt_test.lua\nlocal lcrypt        = require(\"lcrypt\")\n\nlocal log_info      = logger.info\nlocal lmd5          = lcrypt.md5\nlocal lrandomkey    = lcrypt.randomkey\nlocal lb64encode    = lcrypt.b64_encode\nlocal lb64decode    = lcrypt.b64_decode\nlocal lhex_encode   = lcrypt.hex_encode\n\nlocal lsha1         = lcrypt.sha1\nlocal lsha224       = lcrypt.sha224\nlocal lsha256       = lcrypt.sha256\nlocal lsha384       = lcrypt.sha384\nlocal lsha512       = lcrypt.sha512\n\nlocal lhmac_sha1    = lcrypt.hmac_sha1\nlocal lhmac_sha224  = lcrypt.hmac_sha224\nlocal lhmac_sha256  = lcrypt.hmac_sha256\nlocal lhmac_sha384  = lcrypt.hmac_sha384\nlocal lhmac_sha512  = lcrypt.hmac_sha512\n\n--base64\nlocal ran = lrandomkey()\nlocal nonce = lb64encode(ran)\nlocal dnonce = lb64decode(nonce)\nlog_info(\"b64encode-\u003e ran: %s, nonce: %s, dnonce:%s\", lhex_encode(ran), lhex_encode(nonce), lhex_encode(dnonce))\n\n--sha\nlocal value = \"123456779\"\nlocal sha1 = lhex_encode(lsha1(value))\nlog_info(\"sha1: %s\", sha1)\nlocal sha224 = lhex_encode(lsha224(value))\nlog_info(\"sha224: %s\", sha224)\nlocal sha256 = lhex_encode(lsha256(value))\nlog_info(\"sha256: %s\", sha256)\nlocal sha384 = lhex_encode(lsha384(value))\nlog_info(\"sha384: %s\", sha384)\nlocal sha512 = lhex_encode(lsha512(value))\nlog_info(\"sha512: %s\", sha512)\n\n--md5\nlocal omd5 = lmd5(value)\nlocal nmd5 = lmd5(value, 1)\nlocal hmd5 = lhex_encode(omd5)\nlog_info(\"md5: %s\", nmd5)\nlog_info(\"omd5: %s, hmd5: %s\", omd5, hmd5)\n\n--hmac_sha\nlocal key = \"1235456\"\nlocal hmac_sha1 = lhex_encode(lhmac_sha1(key, value))\nlog_info(\"hmac_sha1: %s\", hmac_sha1)\nlocal hmac_sha224 = lhex_encode(lhmac_sha224(key, value))\nlog_info(\"hmac_sha224: %s\", hmac_sha224)\nlocal hmac_sha256 = lhex_encode(lhmac_sha256(key, value))\nlog_info(\"hmac_sha256: %s\", hmac_sha256)\nlocal hmac_sha384 = lhex_encode(lhmac_sha384(key, value))\nlog_info(\"hmac_sha384: %s\", hmac_sha384)\nlocal hmac_sha512 = lhex_encode(lhmac_sha512(key, value))\nlog_info(\"hmac_sha512: %s\", hmac_sha512)\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiyoo0812%2Flcrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiyoo0812%2Flcrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiyoo0812%2Flcrypt/lists"}