@blockr/blockr-crypto
v1.0.0-1
Published
Small library for cryptography operations.
Downloads
4
Readme
blockr-crypto
small library for cryptography operations
|CI|SonarQube|Version| |:-:|:-:|:-:| ||||
The utilities exposed by this library can be consumed either by dependency injection
or normal construction.
Importing
ES6
import { ObjectHasher } from "@blockr/blockr-crypto";
ES5
const ObjectHasher = require("@blockr/blockr-crypto");
Dependency injection
This library uses inversify-js
as its dependency injection library. This means the consuming project is required to do the same.
Example:
This example uses the
ObjectHasher
util.
container
DIContainer.bind<ObjectHasher>(ObjectHasher).toSelf().inTransientScope();
consumer (typically a service)
class MainService {
private objectHasher: ObjectHasher;
constructor(@inject(ObjectHasher) objectHasher: ObjectHasher) {
this.objectHasher = objectHasher;
}
}
Normal construction
Example:
consumer (typically a service)
class MainService {
private objectHasher: ObjectHasher;
constructor() {
this.objectHasher = new ObjectHasher();
}
}