All Projects → segmentio → Fasthash

segmentio / Fasthash

Licence: mit
Go package porting the standard hashing algorithms to a more efficient implementation.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Fasthash

Password4j
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.
Stars: ✭ 124 (-23.93%)
Mutual labels:  hash
Piecewise linear fit py
fit piecewise linear data for a specified number of line segments
Stars: ✭ 141 (-13.5%)
Mutual labels:  segment
Dagon
Advanced Hash Manipulation
Stars: ✭ 155 (-4.91%)
Mutual labels:  hash
Webpack Plugin Hash Output
Plugin to replace webpack chunkhash with an md5 hash of the final file conent.
Stars: ✭ 128 (-21.47%)
Mutual labels:  hash
Swift project
原OC项目用swift实现,纯swift项目,可作为学习swift的demo,包含多个自定义控件,并且进行封装网络请求库,结构清晰。
Stars: ✭ 133 (-18.4%)
Mutual labels:  segment
Analytics React
[DEPRECATED AND UNSUPPORTED] The hassle-free way to integrate analytics into your React application.
Stars: ✭ 146 (-10.43%)
Mutual labels:  segment
Merkle
Node.js module implementing Merkle tree algorithm
Stars: ✭ 123 (-24.54%)
Mutual labels:  hash
Loki
Loki - Simple IOC and Incident Response Scanner
Stars: ✭ 2,217 (+1260.12%)
Mutual labels:  hash
React Scrollchor
A React component for scroll to `#hash` links with smooth animations
Stars: ✭ 141 (-13.5%)
Mutual labels:  hash
Pytorch deephash
Pytorch implementation of Deep Learning of Binary Hash Codes for Fast Image Retrieval, CVPRW 2015
Stars: ✭ 148 (-9.2%)
Mutual labels:  hash
Imagehash
🌄 Perceptual image hashing for PHP
Stars: ✭ 1,744 (+969.94%)
Mutual labels:  hash
Hashlib4pascal
Hashing for Modern Object Pascal
Stars: ✭ 132 (-19.02%)
Mutual labels:  hash
Typewriter
Type safety + intellisense for your Segment analytics
Stars: ✭ 146 (-10.43%)
Mutual labels:  segment
Evergreen
🌲 Evergreen React UI Framework by Segment
Stars: ✭ 11,340 (+6857.06%)
Mutual labels:  segment
Mxscroll
Easier with scroll
Stars: ✭ 159 (-2.45%)
Mutual labels:  segment
Jxsegmentedview
A powerful and easy to use segmented view (segmentedcontrol, pagingview, pagerview, pagecontrol, categoryview) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 1,905 (+1068.71%)
Mutual labels:  segment
Tlsh Js
JavaScript port of TLSH (Trend Micro Locality Sensitive Hash)
Stars: ✭ 143 (-12.27%)
Mutual labels:  hash
Textanalyzer
A text analyzer which is based on machine learning,statistics and dictionaries that can analyze text. So far, it supports hot word extracting, text classification, part of speech tagging, named entity recognition, chinese word segment, extracting address, synonym, text clustering, word2vec model, edit distance, chinese word segment, sentence similarity,word sentiment tendency, name recognition, idiom recognition, placename recognition, organization recognition, traditional chinese recognition, pinyin transform.
Stars: ✭ 162 (-0.61%)
Mutual labels:  segment
Crypto Async
Fast, reliable cipher, hash and hmac methods executed in Node's threadpool for multi-core throughput.
Stars: ✭ 161 (-1.23%)
Mutual labels:  hash
Murmurhash3.js
MurmurHash3, in JavaScript.
Stars: ✭ 147 (-9.82%)
Mutual labels:  hash

fasthash CircleCI Go Report Card GoDoc

Go package porting the standard hashing algorithms to a more efficient implementation.

Motivations

Go has great support for hashing algorithms in the standard library, but the APIs are all exposed as interfaces, which means passing strings or byte slices to those require dynamic memory allocations. Hashing a string typically requires 2 allocations, one for the Hash value, and one to covert the string to a byte slice.

This package attempts to solve this issue by exposing functions that implement string hashing algorithms and don't require dynamic memory alloations.

Testing

To ensure consistency between the fasthash package and the standard library, all tests must be implemented to run against the standard hash functions and validate that both packages produced the same results.

Benchmarks

The implementations also have to prove that they are more efficient in terms of CPU and memory usage than the functions found in the standard library.
Here's an example with fnv-1a:

BenchmarkHash64/standard_hash_function 20000000   105.0 ns/op   342.31 MB/s   56 B/op   2 allocs/op
BenchmarkHash64/hash_function          50000000    38.6 ns/op   932.35 MB/s    0 B/op   0 allocs/op

Usage Example: FNV-1a

package main

import (
    "fmt"

    "github.com/segmentio/fasthash/fnv1a"
)

func main() {
    // Hash a single string.
    h1 := fnv1a.HashString64("Hello World!")
    fmt.Println("FNV-1a hash of 'Hello World!':", h1)

    // Incrementally compute a hash value from a sequence of strings.
    h2 := fnv1a.Init64
    h2 = fnv1a.AddString64(h2, "A")
    h2 = fnv1a.AddString64(h2, "B")
    h2 = fnv1a.AddString64(h2, "C")
    fmt.Println("FNV-1a hash of 'ABC':", h2)
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].