
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Get a cardinality of a set, multiple set unions and intersections!
To see what problem ANiq is tackling, please read ANiq — counting distinct values at scale
npm install aniq
Copy sample.json
to production.json
. Modify per your settings.
cd node_modules/aniq/
NODE_ENV=production node app.js
Add a member to KMV
URL : /add/:key/
URL Parameters : key=[string]
where key
is a name of the KMV.
Method : PUT
Data constraints
[
"[string]",
"[string]",
"...etc"
]
OR
[string]
Data example As an array or string
[
"Canada",
"US",
"Mexico"
]
OR
Canada
Condition : If key and at least one member is provided.
Code : 200 OK
Content example
{
"result": "OK"
}
Condition : If no member value is provided
Code : 400 BAD REQUEST
Content :
{
"code": "api-2",
"message": "Members parameter should either be a string or an array of strings"
}
OR
Condition : If no key is provided.
Code : 404 NOT FOUND
Content :
{"code": "ResourceNotFound"}
Return the cardinality of a KMV
URL : /cardinality/:key/
URL Parameters : key=[string]
where key
is a name of the KMV.
Method : GET
Condition : If key is provided.
Code : 200 OK
Content example
{
"result": "[int]"
}
Condition : If no key is provided.
Code : 404 NOT FOUND
Content :
{"code": "ResourceNotFound"}
Return the cardinality of a multiple KMV union.
URL : /union/:keys/
URL Parameters : keys=[string,]
where keys
is comma separated names of the KMVs.
Method : GET
Condition : If two or more keys are provided.
Code : 200 OK
Content example
{
"result": "[int]"
}
Condition : If no key is provided.
Code : 404 NOT FOUND
Content :
{"code": "ResourceNotFound"}
OR
Condition : If only one key is provided
Code : 400 BAD REQUEST
Content :
{
"code": "api-3",
"message": "Keys parameter should be an array of two or more key strings"
}
Return the cardinality of a multiple KMV intersection.
URL : /union/:keys/
URL Parameters : keys=[string,]
where keys
is comma separated names of the KMVs.
Method : GET
Condition : If one or more keys are provided.
Code : 200 OK
Content example
{
"result": "[int]"
}
Condition : If no key is provided.
Code : 404 NOT FOUND
Content :
{"code": "ResourceNotFound"}
OR
Condition : If only one key is provided
Code : 400 BAD REQUEST
Content :
{
"code": "api-3",
"message": "Keys parameter should be an array of two or more key strings"
}
Sample architecture is as follows:
r1 r2 r3 r4 r5 r6 r7 r8 (redis instances)
s1 s2 (redis servers)
f1 (client)
s1, s2 and f1 can be on the same server. r1-r4 and r5-r8 should be on separate servers.
s1, s1 and f1 should be two or more identical servers to remove single point of failure.
f1 has a replication factor and writePolicy of 2. If you don't want replication or are using Redis standard one, you can
disable this via config.
NOTE: Requires Redis (localhost and ports 6379-6832) to be installed (4 instances for full testing)
Copy sample.json
to testing.json
. Modify per your settings.
npm test
npm run lint
Go nuts! Just don't forget to test and lint. Credit will be given where it's due.
FAQs
Scalable distinct value counting system
The npm package aniq receives a total of 2 weekly downloads. As such, aniq popularity was classified as not popular.
We found that aniq 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.