{"id":20708448,"url":"https://github.com/hisdream86/go-anonymizer","last_synced_at":"2026-06-01T05:31:30.236Z","repository":{"id":144204755,"uuid":"224372715","full_name":"hisdream86/go-anonymizer","owner":"hisdream86","description":"Simple anonymizer for any structured data","archived":false,"fork":false,"pushed_at":"2020-02-15T03:09:28.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-25T17:10:48.954Z","etag":null,"topics":["anonymization","deidentification","go"],"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/hisdream86.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,"publiccode":null,"codemeta":null}},"created_at":"2019-11-27T07:41:13.000Z","updated_at":"2023-09-03T09:07:26.000Z","dependencies_parsed_at":"2023-06-18T19:07:48.740Z","dependency_job_id":null,"html_url":"https://github.com/hisdream86/go-anonymizer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hisdream86/go-anonymizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisdream86%2Fgo-anonymizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisdream86%2Fgo-anonymizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisdream86%2Fgo-anonymizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisdream86%2Fgo-anonymizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hisdream86","download_url":"https://codeload.github.com/hisdream86/go-anonymizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisdream86%2Fgo-anonymizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33762215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["anonymization","deidentification","go"],"created_at":"2024-11-17T01:31:25.496Z","updated_at":"2026-06-01T05:31:30.219Z","avatar_url":"https://github.com/hisdream86.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Anonymizer\nSimple anonymization tool for de-identifying your structurized data. You can easily anonymize your data with *Struct Tag* `anonymize:\"{replacer}\"`.\n\n*Note: only string values are supported*\n\n# Installation\n    $ go get github.com/hisdream86/go-anonymizer\n\n# Example\n```go\npackage main\n\nimport (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\n\tanonymizer \"github.com/hisdream86/go-anonymizer\"\n)\n\ntype Example struct {\n\t// Anonymize with asterisk (*)\n\tMaskedField string `anonymize:\"asterisk\"`\n\t// Anonymize to empty string (\"\")\n\tEmptyField string `anonymize:\"empty\"`\n\t// Anonymize with custom handler\n\tCustomField string `anonymize:\"mysha256\"`\n\t// Anoymize nested Field\n\tNestedField struct {\n\t\tMaskedField string `anonymize:\"asterisk\"`\n\t}\n\t// Anonymize array Field\n\tArrayField []string `anonymize:\"asterisk\"`\n\t// Don't anonymize\n\tPlainField string\n}\n\ntype NestedField struct {\n\tMaskedField string `anonymize:\"asterisk\"`\n}\n\nfunc main() {\n\tvar target = Example{\n\t\tMaskedField: \"MaskedField\",\n\t\tEmptyField:  \"EmptystringField\",\n\t\tCustomField: \"CustomField\",\n\t\tPlainField:  \"PlainField\",\n\t\tNestedField: NestedField{\n\t\t\tMaskedField: \"NestedMaskedField\",\n\t\t},\n\t\tArrayField: []string{\"Field 1\", \"Field 2\"},\n\t}\n\n\t// Register custom replacer for anonymizing data with SHA256 hashing\n\tanonymizer.AddCustomReplacer(\"mysha256\", func(source string) string {\n\t\th := sha256.New()\n\t\th.Write([]byte(source))\n\t\treturn hex.EncodeToString(h.Sum(nil))\n\t})\n\n\tif err := anonymizer.Anonymize(\u0026target); err != nil {\n\t\tfmt.Println(\"Fail to anonymize target data.\")\n\t}\n\n\tfmt.Println(target)\n}\n```\n\n# Replacers\n\n## Default Replacers\nGo Anonymizer provides following default replacers.\n\n### asterisk\nReplace your data with multiple asterisks `*`. The number of asterisk character is same with your string's length.\n\n\u003e \"Hello World\" -\u003e \"***********\"\n\n### empty\nReplace your data with empty string.\n\n\u003e \"Hello World\" -\u003e \"\"\n\n## Custom Replacers\nIf you want to use your custom replacer, you can use `AddCustomReplacer()` and `RemoveCustomReplacer()`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhisdream86%2Fgo-anonymizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhisdream86%2Fgo-anonymizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhisdream86%2Fgo-anonymizer/lists"}