
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
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.
The code is written in ES6. If you are not using the ES6
import, then you must use the default method that is exported.
ziptag(object, [ignorePaths], [maxDepth]) => stringExamples:
const ziptag = require('ziptag').default
// 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?
Copyright © 2017-present Foko Inc. All rights reserved.
Licensed under the MIT license.
FAQs
Fast etags for JSON.
The npm package ziptag receives a total of 17 weekly downloads. As such, ziptag popularity was classified as not popular.
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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.