{"id":17281502,"url":"https://github.com/sumory/basen4go","last_synced_at":"2025-03-26T15:25:35.169Z","repository":{"id":23886475,"uuid":"27265720","full_name":"sumory/baseN4go","owner":"sumory","description":"baseN for go","archived":false,"fork":false,"pushed_at":"2014-12-08T02:17:04.000Z","size":160,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T16:56:05.889Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sumory.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":"2014-11-28T12:14:35.000Z","updated_at":"2015-04-17T07:59:58.000Z","dependencies_parsed_at":"2022-08-22T06:10:40.032Z","dependency_job_id":null,"html_url":"https://github.com/sumory/baseN4go","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/sumory%2FbaseN4go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumory%2FbaseN4go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumory%2FbaseN4go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumory%2FbaseN4go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumory","download_url":"https://codeload.github.com/sumory/baseN4go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245679643,"owners_count":20654871,"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":[],"created_at":"2024-10-15T09:46:02.402Z","updated_at":"2025-03-26T15:25:35.135Z","avatar_url":"https://github.com/sumory.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## baseN4go\n\n[![Build Status](https://travis-ci.org/sumory/baseN4go.svg?branch=master)](https://travis-ci.org/sumory/baseN4go) [![](http://gocover.io/_badge/github.com/sumory/baseN4go)](http://gocover.io/github.com/sumory/baseN4go) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/sumory/baseN4go/master/LICENSE)\n\n\n#### 介绍\n\n - 查看[baseN][1]，[baseN4j][2]，这是go版本.\n\n\n\n#### 使用\n\ngo get github.com/sumory/baseN4go\n\n默认数组:\n\n```go\n[]string{\n\t\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\",\n\t\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\",\n\t\"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",\n\t\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\",\n\t\"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"}\n```\n\n取默认数组前N项作为基数\n\n```go\nvar N int64 = 16\nerr, baseN := baseN4go.NewBaseN(N) //16进制\n_, encodeResult := baseN.Encode(123456)\n_, decodeResult := baseN.Decode(encodeResult)\n```\n\n自定义基数\n\n```go\nerr, baseN := baseN4go.NewBaseN([]string{\"a\", \"b\", \"c\", \"d\"}) //四进制\n_, encodeResult := baseN.Encode(123456)\n_, decodeResult := baseN.Decode(encodeResult)\n```\n\n\n#### TODO\n\n性能较低，待优化`Encode`和`Decode`方法\n\n\n[1]: https://github.com/sumory/baseN\n[2]: https://github.com/sumory/baseN4j","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumory%2Fbasen4go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsumory%2Fbasen4go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumory%2Fbasen4go/lists"}