Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@digitalcredentials/rdf-canonize
Advanced tools
An implementation of the RDF Dataset Normalization Algorithm in JavaScript
An implementation of the RDF Dataset Normalization Algorithm in JavaScript.
...
npm install rdf-canonize
const canonize = require('rdf-canonize');
This package has support for rdf-canonize-native. This package can be useful if your application requires doing many canonizing operations asyncronously in parallel or in the background. It is highly recommended that you understand your requirements and benchmark using JavaScript vs native bindings. The native bindings add overhead and the JavaScript implementation may be faster with modern runtimes.
The native bindings are not installed by default and must be explicitly installed.
npm install rdf-canonize
npm install rdf-canonize-native
Note that the native code is not automatically used. To use the native bindings
you must have them installed and set the useNative
option to true
.
const canonize = require('rdf-canonize');
Install in your project with npm and use your favorite browser bundler tool.
const dataset = {
// ...
};
// canonize a data set with a particular algorithm with async/await
const canonical = await canonize.canonize(dataset, {algorithm: 'URDNA2015'});
// canonize a data set with a particular algorithm and force use of the
// native implementation
const canonical = await canonize.canonize(dataset, {
algorithm: 'URDNA2015',
useNative: true
});
This library includes a sample testing utility which may be used to verify that changes to the processor maintain the correct output.
The test suite is included in an external repository:
https://github.com/json-ld/normalization
This should be a sibling directory of the rdf-canonize directory or in a
test-suites
dir. To clone shallow copies into the test-suites
dir you can
use the following:
npm run fetch-test-suite
Node.js tests can be run with a simple command:
npm test
If you installed the test suites elsewhere, or wish to run other tests, use
the TEST_DIR
environment var:
TEST_DIR="/tmp/tests" npm test
To generate earl reports:
# generate the earl report for node.js
EARL=earl-node.jsonld npm test
Browser testing with karma is done indirectly through jsonld.js.
See docs in the benchmark README.
The source code for this library is available at:
https://github.com/digitalbazaar/rdf-canonize
Commercial support for this library is available upon request from Digital Bazaar: support@digitalbazaar.com
1.0.0 - 2019-01-23
rdf-canonize-native
yourself. It is no longer a dependency. See below.rdf-canonize-native
as a dependency. The native
bindings will still be used if rdf-canonize-native
can be loaded. This
means if you want the native bindings you must install them yourself. This
change was done due to various problems caused by having any type of
dependency involving the native code. With modern runtimes the JavaScript
implementation is in many cases faster. The native bindings do have
overhead but can be useful in cases where you need to offload canonizing into
the background. It is recommended to perform benchmarks to determine which
method works best in your case.usePureJavaScript
option and make the JavaScript
implementation the default. Add explicit useNative
option to force the use
of the native implementation from rdf-canonize-native
. An error will be
thrown if native bindings are not available.FAQs
An implementation of the RDF Dataset Normalization Algorithm in JavaScript
We found that @digitalcredentials/rdf-canonize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.