#sliding #variables #precision #aggregation #correlation #time #timehash

timeharsh

timeharsh implements the timehash algorithm, an algorithm for creating user configurable, variable-precision sliding windows of time. Useful for binning time values in large collections of data.

2 releases (1 stable)

Uses old Rust 2015

1.0.0 Jun 23, 2024
0.1.0 Mar 8, 2017

#691 in Algorithms

Download history 4/week @ 2024-07-30 4/week @ 2024-09-10 1/week @ 2024-09-17 8/week @ 2024-09-24 14/week @ 2024-10-01

74 downloads per month

Custom license

11KB
171 lines

timeharsh Build Status

Timehash in Rust

This project is a Rust implementation of the timehash algorithm. The original algorithm was written in Python by Abe Usher and is available at https://github.com/abeusher/timehash

timehash is an algorithm (with multiple reference implementations) for calculating variable precision sliding windows of time. When performing aggregations and correlations on large-scale data sets, the ability to convert precise time values into 'malleable intervals' allows for many novel analytics.

An example use case of timehash is described in the following paper: https://isprs-annals.copernicus.org/articles/IV-4-W2/31/2017/isprs-annals-IV-4-W2-31-2017.pdf

Usage

extern crate timeharsh;

let hash1 = timehash::encode(1236532473.6328125, 6).unwrap();
// hash1 == "abcdef"

let t1 = timeharsh::timehash::decode("abcdef").unwrap();
// t1 == 1236532473.6328125

Building the project

cargo build

Running the tests

cargo test

No runtime deps