{"id":24464498,"url":"https://github.com/dongri/god","last_synced_at":"2025-04-13T07:12:21.149Z","repository":{"id":29485782,"uuid":"33023040","full_name":"dongri/god","owner":"dongri","description":"god","archived":false,"fork":false,"pushed_at":"2024-12-09T04:12:34.000Z","size":35,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T07:12:12.157Z","etag":null,"topics":["beacon","creditcard","go","utils"],"latest_commit_sha":null,"homepage":"","language":"Go","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/dongri.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}},"created_at":"2015-03-28T06:07:30.000Z","updated_at":"2024-12-09T06:54:26.000Z","dependencies_parsed_at":"2022-08-22T06:51:06.092Z","dependency_job_id":null,"html_url":"https://github.com/dongri/god","commit_stats":null,"previous_names":["dongri/gou","dongri/gomen"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Fgod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Fgod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Fgod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongri%2Fgod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dongri","download_url":"https://codeload.github.com/dongri/god/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675423,"owners_count":21143768,"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":["beacon","creditcard","go","utils"],"created_at":"2025-01-21T05:15:52.125Z","updated_at":"2025-04-13T07:12:21.119Z","avatar_url":"https://github.com/dongri.png","language":"Go","readme":"# God 神\n\n### Installation\n\n```\n$ go get github.com/dongri/god\n```\n\n### Detect Credit Card Type\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\tcardType1 := god.DetectCardType(\"4111111111111\")\n\tfmt.Println(cardType1) // Visa\n\tcardType2 := god.DetectCardType(\"5555555555554444\")\n\tfmt.Println(cardType2) // Master\n}\n```\n\n### Date Format\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"time\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\ttime, _ := time.Parse(\"2006-01-02 15:04:05\", \"2015-03-04 23:29:23\")\n\tformatedDate := god.DateFormat(time, \"%Y年%m月%d日 %H時%M分%S秒\")\n\tfmt.Println(formatedDate) // 2015年03月04日 23時29分23秒\n}\n```\n\n### Random\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\trandom := new(god.Random)\n\trandom.UseNumber()\n\trandom.UseSmallLetter()\n\trandom.UseCapitalLetter()\n\tr := random.Random(20)\n\tfmt.Println(r) // 6Zyk2vOQYNIKmbIa6BcH\n}\n```\n\n### Sha1\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\ts := god.Sha512Sum512(\"hello\"))\n\tfmt.Println(s)\n}\n```\n\n### Cipher\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\tencryptedText, err := god.EncryptString(\"passwordpasswordpasswordpassword\", \"hoge\")\n\tfmt.Println(err, encryptedText)\n}\n```\n\n### Beacon\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\tmajor, minor := god.PackBeacon(1,2,8)\n\tfmt.Println(major, minor)\n\n\tmajor, minor := god.UnpackBeacon(0, 258,8)\n\tfmt.Println(major, minor)\n}\n```\n\n### Int min, max\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\tmax := god.MaxOf(4, 6, 9, 7, 2, 1, 8)\n\tfmt.Println(max) // 9\n}\n```\n\n### Replace hyphen\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\tresult := god.ReplaceHyphen(\"test-testーテスト█测试▬테스트\", HANKAKU_HYPHEN)\n\tfmt.Println(result) // test-test-テスト-测试-테스트\n}\n```\n\n### Replace wave dash\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\nfunc main() {\n\tresult := god.ReplaceWaveDash(\"test῀test∼テスト～测试〜테스트\")\n\tfmt.Println(result) // test~test~テスト~测试~테스트\n}\n```\n\n### Caesar Cipher\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/dongri/god\"\n)\n\nfunc main() {\n\tcaesarCipher := god.NewCaesarCipher(3)\n\tencrypted := caesarCipher.Encrypt(\"hello\")\n\tfmt.Println(encrypted) // khoor\n}\n```\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Dongri Jin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongri%2Fgod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongri%2Fgod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongri%2Fgod/lists"}