Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.28 KB

README.md

File metadata and controls

53 lines (36 loc) · 1.28 KB

This project has been archived. Please check out tidwall/hashmap for a fitter, happier, more productive hashmap library.

rhh

GoDoc

A simple and efficient hashmap package for Go using the xxhash algorithm, open addressing, and robin hood hashing.

This is an alternative to the standard Go map.

Getting Started

Installing

To start using rhh, install Go and run go get:

$ go get github.com/tidwall/rhh

This will retrieve the library.

Usage

The Map type works similar to a standard Go map, and includes four methods: Set, Get, Delete, Len.

var m rhh.Map
m.Set("Hello", "Dolly!")
val, _ := m.Get("Hello")
fmt.Printf("%v\n", val)
val, _ = m.Delete("Hello")
fmt.Printf("%v\n", val)
val, _ = m.Get("Hello")
fmt.Printf("%v\n", val)

// Output:
// Dolly!
// Dolly!
// <nil>

Contact

Josh Baker @tidwall

License

Source code is available under the MIT License.