Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amallia/go-ef
A Go implementation of the Elias-Fano encoding
https://github.com/amallia/go-ef
compression elias-fano eliasfano encoding
Last synced: about 2 months ago
JSON representation
A Go implementation of the Elias-Fano encoding
- Host: GitHub
- URL: https://github.com/amallia/go-ef
- Owner: amallia
- License: mit
- Created: 2017-09-22T01:47:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T01:33:26.000Z (6 months ago)
- Last Synced: 2024-07-31T20:45:41.316Z (4 months ago)
- Topics: compression, elias-fano, eliasfano, encoding
- Language: Go
- Size: 28.3 KB
- Stars: 31
- Watchers: 5
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - go-ef - A Go implementation of the Elias-Fano encoding. (Data Structures and Algorithms / Bit-packing and Compression)
- awesome-go - go-ef - A Go implementation of the Elias-Fano encoding. (Data Structures and Algorithms / Bit-packing and Compression)
- awesome-go - go-ef - A Go implementation of the Elias-Fano encoding - ★ 8 (Data Structures)
- awesome-go-extra - go-ef - Fano encoding|23|7|0|2017-09-22T01:47:16Z|2017-09-25T20:07:11Z| (Generators / Bit-packing and Compression)
README
# go-ef
_A Go implementation of the Elias-Fano encoding_[![Build Status](https://travis-ci.org/amallia/go-ef.svg?branch=master)](https://travis-ci.org/amallia/go-ef) [![GoDoc](https://godoc.org/github.com/amallia/go-ef?status.svg)](https://godoc.org/github.com/amallia/go-ef) [![Go Report Card](https://goreportcard.com/badge/github.com/amallia/go-ef)](https://goreportcard.com/report/github.com/amallia/go-ef) ![cover.run go](https://cover.run/go/github.com/amallia/go-ef.svg)
### Example
```go
package main
import (
"fmt"
"github.com/amallia/go-ef"
"os"
)func main() {
array := []uint64{1,5,10}
size := len(array)
max := array[size-1]
obj := ef.New(max, size)obj.Compress(array)
v, err := obj.Next()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println(v) // 1obj.Next()
fmt.Println(obj.Value()) // 5
}
```