
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
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.
Using `sliding windows of time is a common practice in data analysis but prior to the timehash algorithm it was more of an art than a science. -- abeusher/timehash
npm install time-hash -s
npm install
npm run:cover
Improved browser compatability in Rollup
timehash.encodems(new Date().getTime()) // encodes from milliseconds epoch instead of timeseconds
timehash.decodems('000000000b') // decodes to milliseconds epoch instead of timeseconds
reason: Better compatability with Javascript Date() functions
var TimeHash = require('time-hash') // or import TimeHash from 'time-hash'
let timehash = new TimeHash()
let [begin, cease] = ['1970-01-01 00:00:00 GMT', '2098-01-01 00:00:00 GMT'] // should use UTC/GMT
let begin_input = new Date(begin)
let pivot_input = new Date('2034-01-01 00:00:00 GMT')
let cease_input = new Date(cease)
let begin_hash = timehash.encode_from_datetime(begin_input)
let pivot_hash = timehash.encode_from_datetime(pivot_input)
let cease_hash = timehash.encode_from_datetime(cease_input)
`${begin_hash}`
'0000000000'
`${pivot_hash}`
'bfffffffff'
`${cease_hash}`
'ffffffffff'
begin_hash_after = timehash.after(begin_hash)
`${begin_hash_after}`
'0000000001'
`${timehash.before(begin_hash_after)}` === begin_hash
let [neighbor_before, neighbor_after] = timehash.neighbors('000000000a')
`${timehash.before(neighbor_before)}` === begin_hash
`${neighbor_after}` === '000000000b'
let input = '000000000a'
let expand = timehash.expand(input)
let [expand_before, input_clone, expand_after] = expand
`${expand_before}` === timehash.before(input_clone)
`${expand_after}` === timehash.after(input_clone)
let [begin_value, begin_error] = timehash.decode_exactly('0000000000')
new Date(begin_value - begin_error).toString() === begin_input.toString()
Copyright © 2017 LoreFolk, LLC. This source code is licensed under the MIT license found in the LICENSE.txt file. The documentation to the project is licensed under the CC BY-SA 4.0 license.
Reference implement made with ♥ by Abe Usher Abe Usher and [contributors] (https://github.com/abeusher/timehash/blob/master/CONTRIBUTORS.md)
Testing/DepoymentTemplate made with ♥ by Konstantin Tarkus (@koistya) and contributors
FAQs
UTC/GMT Time Hash for milliseconds/timestamps
We found that time-hash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.