@blockr/blockr-crypto
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-1 • Public • Published

blockr-crypto

small library for cryptography operations

CI SonarQube Version
Build Status Quality Gate Status npm

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();
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @blockr/blockr-crypto

Weekly Downloads

1

Version

1.0.0-1

License

MIT

Unpacked Size

31.9 kB

Total Files

36

Last publish

Collaborators

  • saltz