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: 9 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 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T01:33:26.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:45:41.316Z (over 1 year 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-cn - go-ef - Fano 编码。 [![godoc][D]](https://godoc.org/github.com/amallia/go-ef) (数据结构与算法 / Bit-packing和压缩)
- 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 / Advanced Console UIs)
- awesome-go - go-ef - Fano encoding. | - | - | - | (Data Structures / Advanced Console UIs)
- awesome-go - go-ef - A Go implementation of the Elias-Fano encoding. (Data Structures and Algorithms / Bit-packing and Compression)
- awesome-go-cn - go-ef - Fano编码的Go实现。 (A Go implementation of the Elias-Fano encoding.) (数据结构 / Advanced Console UIs)
- awesome-go-plus - go-ef - A Go implementation of the Elias-Fano encoding.  (Data Structures and Algorithms / Bit-packing and Compression)
- awesome-go - go-ef - GO语言实现Elias-Fano编码。 (<span id="数据结构-data-structures">数据结构 Data Structures</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go - go-ef - A Go implementation of the Elias-Fano encoding - ★ 8 (Data Structures)
- 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. - :arrow_down:0 - :star:5 (Data Structures / Advanced Console UIs)
- awesome-go-cn - go-ef - Fano`编码的`Go`实现。 (数据结构 / 标准 CLI)
- fucking-awesome-go - go-ef - A Go implementation of the Elias-Fano encoding. (Data Structures and Algorithms / Bit-packing and Compression)
- 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)
- awesome-go - go-ef - A Go implementation of the Elias-Fano encoding. (Data Structures and Algorithms / Bit-packing and Compression)
- awesome-go-with-stars - go-ef - A Go implementation of the Elias-Fano encoding. (Data Structures and Algorithms / Bit-packing and Compression)
- awesome-go - amallia/go-ef - Fano encoding ☆`40` (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-Char - go-ef - A Go implementation of the Elias-Fano encoding. (Data Structures / Advanced Console UIs)
- awesome-go-cn - go-ef - Fano 编码。 [![近三年未更新][Y]](https://github.com/amallia/go-ef) [![godoc][D]](https://godoc.org/github.com/amallia/go-ef) (数据结构与算法 / Bit-packing和压缩)
- awesome-go - go-ef - A Go implementation of the Elias-Fano encoding. (Data Structures / Advanced Console UIs)
README
# go-ef
_A Go implementation of the Elias-Fano encoding_
[](https://travis-ci.org/amallia/go-ef) [](https://godoc.org/github.com/amallia/go-ef) [](https://goreportcard.com/report/github.com/amallia/go-ef) 
### 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) // 1
obj.Next()
fmt.Println(obj.Value()) // 5
}
```