{"id":17118950,"url":"https://github.com/chyroc/base8-bagua","last_synced_at":"2026-02-28T10:31:52.597Z","repository":{"id":57502934,"uuid":"155729078","full_name":"chyroc/base8-bagua","owner":"chyroc","description":"八卦图形base64","archived":false,"fork":false,"pushed_at":"2018-11-02T06:36:15.000Z","size":10,"stargazers_count":32,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-14T22:12:31.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chyroc.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":"2018-11-01T14:38:20.000Z","updated_at":"2025-05-18T10:03:05.000Z","dependencies_parsed_at":"2022-09-02T01:52:10.863Z","dependency_job_id":null,"html_url":"https://github.com/chyroc/base8-bagua","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chyroc/base8-bagua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fbase8-bagua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fbase8-bagua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fbase8-bagua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fbase8-bagua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chyroc","download_url":"https://codeload.github.com/chyroc/base8-bagua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Fbase8-bagua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29930344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-14T17:55:51.674Z","updated_at":"2026-02-28T10:31:52.560Z","avatar_url":"https://github.com/chyroc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base8-bagua\n\n八卦图形base8\n\n## install\n```bash\ngo get -u github.com/Chyroc/base8-bagua/cmd/...\n```\n\n## usage\n\n```bash\nbase8-bagua -h\nNAME\n     base8-bagua -- Encode and decode using Base8-Bagua representation\n\nSYNOPSIS\n     base8 [-D|-h]\n```\n\n```bash\necho 'hello base8-bagua' | base8-bagua\n☳☲☰☶☲☵☵☴☳☳☰☶☷☴☴☰☳☰☴☶☰☵☶☳☳☱☲☳☴☰☵☵☳☰☴☶☰☵☴☷☳☵☲☶☰☴\n\necho '☳☲☰☶☲☵☵☴☳☳☰☶☷☴☴☰☳☰☴☶☰☵☶☳☳☱☲☳☴☰☵☵☳☰☴☶☰☵☴☷☳☵☲☶☰☴' | base8-bagua -D\nhello base8-bagua\n```\n\n## 解释\n\n### 符号对应数字\n\n| 符号 | 卦名 | 拼音 | 8进制数 |\n| :--: | :--: | :--: | :-----: |\n|  ☰   |  乾  | qián |    0    |\n|  ☱   |  兑  | duì  |    1    |\n|  ☲   |  离  |  lí  |    2    |\n|  ☳   |  震  | zhèn |    3    |\n|  ☴   |  巽  | xùn  |    4    |\n|  ☵   |  坎  | kǎn  |    5    |\n|  ☶   |  艮  | gèn  |    6    |\n|  ☷   |  坤  | kūn  |    7    |\n\n### encode\n\n* string转成byte数组\n* byte转二进制，拼接byte数组为二进制数组\n* 3个二进制数为一个单位，划分成n份（最后补0）\n* 将每个单位转化成8进制数字（3位二进制范围：0-7）\n* 根据上表的对应关系，换成八卦符号\n* 返回八卦符号字符串\n\n### decode\n\n* 将八卦符号字符串转成8进制数数组\n* 将8进制数字转换成3个二进制数，组成二进制数组\n* 以8个二进制数为一个byte，组成byte数组\n* 返回byte数组\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchyroc%2Fbase8-bagua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchyroc%2Fbase8-bagua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchyroc%2Fbase8-bagua/lists"}