Skip to content

v1.0.0

Latest
Compare
Choose a tag to compare
@EmptyChapter EmptyChapter released this 20 Nov 12:33
dc32df6

Installation

The package is hosted on Github`s npm registry.

To install it, you should add .npmrc file to your project with next line:

@redexinus:registry=https://npm.pkg.github.com

After this you can install the package with this command:

npm i @redexinus/string-hash

Import

Depending on language used in a project, there are two methods to import this lib:

Javascript:

const { StringHasher } = require("@redexinus/string-hash");

ES:

import { StringHasher } from "@redexinus/string-hash";

Optionaly, you might import StringHashOptions for type safety, in case you`ll need to define default hashing options object.

After import, you should initialize StringHasher class:

const options: StringHasherOptions = {
  signature: "hash512",
  algorythm: "sha512",
  saltLength: 32,
  hashLength: 128,
  iterations: 100000,
};

const hasher = new StringHasher(options);