{"id":43316300,"url":"https://github.com/will-rowe/nthash","last_synced_at":"2026-02-01T22:03:42.501Z","repository":{"id":47026699,"uuid":"149345497","full_name":"will-rowe/nthash","owner":"will-rowe","description":"Go implementation of ntHash","archived":false,"fork":false,"pushed_at":"2021-09-16T18:43:03.000Z","size":21,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-07T19:19:18.326Z","etag":null,"topics":["genomics","hashing-algorithm"],"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/will-rowe.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-09-18T20:04:35.000Z","updated_at":"2023-06-16T16:33:24.000Z","dependencies_parsed_at":"2022-08-27T19:01:23.189Z","dependency_job_id":null,"html_url":"https://github.com/will-rowe/nthash","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/will-rowe/nthash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fnthash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fnthash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fnthash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fnthash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/will-rowe","download_url":"https://codeload.github.com/will-rowe/nthash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will-rowe%2Fnthash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28992657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["genomics","hashing-algorithm"],"created_at":"2026-02-01T22:03:42.429Z","updated_at":"2026-02-01T22:03:42.486Z","avatar_url":"https://github.com/will-rowe.png","language":"Go","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003entHash\u003c/h1\u003e\n  \u003ch3\u003e\u003ca href=\"ntHash\"\u003entHash\u003c/a\u003e implementation in Go\u003c/h3\u003e\n  \u003chr\u003e\n  \u003ca href=\"https://travis-ci.org/will-rowe/ntHash\"\u003e\u003cimg src=\"https://travis-ci.org/will-rowe/ntHash.svg?branch=master\" alt=\"travis\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://godoc.org/github.com/will-rowe/nthash\"\u003e\u003cimg src=\"https://godoc.org/github.com/will-rowe/nthash?status.svg\" alt=\"GoDoc\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/will-rowe/ntHash\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/will-rowe/ntHash\" alt=\"goreportcard\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/will-rowe/ntHash\"\u003e\u003cimg src=\"https://codecov.io/gh/will-rowe/ntHash/branch/master/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n## Overview\n\nThis is a Go implementation of the [ntHash](https://github.com/bcgsc/ntHash) recursive hash function for hashing all possible k-mers in a DNA/RNA sequence.\n\nFor more information, read the ntHash [paper](http://dx.doi.org/10.1093/bioinformatics/btw397) by Mohamadi et al. or check out their C++ [implementation](https://github.com/bcgsc/ntHash).\n\nThis implementation was inspired by [Luiz Irber](https://luizirber.org/) and his recent [blog post](https://blog.luizirber.org/2018/09/13/nthash/) on his cool [Rust ntHash implementation](https://github.com/luizirber/nthash).\n\nI have coded this up in Go so that ntHash can be used in my [HULK](https://github.com/will-rowe/hulk) and [GROOT](https://github.com/will-rowe/groot) projects but feel free to use it for yourselves.\n\n## Installation\n\n```go\ngo get github.com/will-rowe/nthash\n```\n\n## Example usage\n\n### range over ntHash values for a sequence\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"github.com/will-rowe/nthash\"\n)\n\nvar (\n    sequence = []byte(\"ACGTCGTCAGTCGATGCAGTACGTCGTCAGTCGATGCAGT\")\n    kmerSize = 11\n)\n\nfunc main() {\n\n    // create the ntHash iterator using a pointer to the sequence and a k-mer size\n    hasher, err := ntHash.New(\u0026sequence, kmerSize)\n\n    // check for errors (e.g. bad k-mer size choice)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // collect the hashes by ranging over the hash channel produced by the Hash method\n    canonical := true\n    for hash := range hasher.Hash(canonical) {\n        log.Println(hash)\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwill-rowe%2Fnthash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwill-rowe%2Fnthash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwill-rowe%2Fnthash/lists"}