
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
Fast RFC-7232 compliant etags for JSON.
Available through npm: npm install --save ziptag.
This module exports a single function which takes any value as input and returns a valid ETag as a string.
For ES2015 import users: this module exports the named export ziptag.
For commonjs users: you're free to do const ziptag = require('ziptag').
ziptag(object, [ignorePaths], [maxDepth]) => stringExamples:
const ziptag = require('ziptag')
// W/"e21zZzonaGVsbG8gd29ybGQn"
ziptag({ msg: 'hello world' })
// W/"e25hbWU6J0pvaG4nYWdlOjIwYmRheTow"
ziptag({ name: 'John', age: 20, bday: new Date(0) })
// W/"e3BlcnNvbjp7bmFtZTonSm9obidhZ2U6MjBiZGF5OjA="
ziptag({
person: {
name: 'John',
age: 20,
bday: new Date(0)
}
})
{ "path.to.key": false }This module is designed to create a very dirty etag as fast
as possible. Due to this, higher priority is given to performance
than collision avoidance. As with any hash function, there are
collisions. Though there will be many more collisions than with
a stronger solution like JSON.stringify (which still has
collisions but significantly less). However, it will outperform
the native JSON stringify.
To see up-to-date benchmark results, check out the travis log.
Makes sense, right?
When packing with webpack, make sure you disable the Buffer builtin to save
some bundle space. Instead, ziptag will make use of the browser's btoa helper.
Copyright © 2017-present Foko Inc. All rights reserved.
Licensed under the MIT license.
FAQs
Fast etags for JSON.
We found that ziptag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.