sha512-crypt-ts
Advanced tools
Comparing version 0.0.19 to 0.1.0
export declare module sha512 { | ||
const sha512crypt: (input: string, salt: string) => string; | ||
const hex_sha512: (input: string) => string; | ||
const b64_sha512: (input: string) => string; | ||
const any_sha512: (input: string, alphabet: string) => string; | ||
const hex_hmac_sha512: (key: string, data: string) => string; | ||
const b64_hmac_sha512: (key: string, data: string) => string; | ||
const any_hmac_sha512: (key: string, data: string, alphabet: string) => string; | ||
const with_b64pad: (b64pad?: string | undefined) => any; | ||
const with_hexcase: (uppercase?: boolean | undefined) => any; | ||
const crypt: (input: string, salt: string) => string; | ||
const hex: (input: string) => string; | ||
const base64: (input: string) => string; | ||
const any: (input: string, alphabet: string) => string; | ||
const hexHmac: (key: string, data: string) => string; | ||
const base64Hmac: (key: string, data: string) => string; | ||
const anyHmac: (key: string, data: string, alphabet: string) => string; | ||
function setBase64Padding(b64pad?: string): void; | ||
function setHexCase(uppercase?: boolean): void; | ||
} |
@@ -452,17 +452,17 @@ "use strict"; | ||
var delegate = new Delegate(); | ||
sha512.sha512crypt = function (input, salt) { return delegate.sha512crypt(input, salt); }; | ||
sha512.hex_sha512 = function (input) { return delegate.rstr2hex(delegate.rstr_sha512(delegate.str2rstr_utf8(input))); }; | ||
sha512.b64_sha512 = function (input) { return delegate.rstr2b64(delegate.rstr_sha512(delegate.str2rstr_utf8(input))); }; | ||
sha512.any_sha512 = function (input, alphabet) { return delegate.rstr2any(delegate.rstr_sha512(delegate.str2rstr_utf8(input)), alphabet); }; | ||
sha512.hex_hmac_sha512 = function (key, data) { return delegate.rstr2hex(delegate.rstr_hmac_sha512(delegate.str2rstr_utf8(key), delegate.str2rstr_utf8(data))); }; | ||
sha512.b64_hmac_sha512 = function (key, data) { return delegate.rstr2b64(delegate.rstr_hmac_sha512(delegate.str2rstr_utf8(key), delegate.str2rstr_utf8(data))); }; | ||
sha512.any_hmac_sha512 = function (key, data, alphabet) { return delegate.rstr2any(delegate.rstr_hmac_sha512(delegate.str2rstr_utf8(key), delegate.str2rstr_utf8(data)), alphabet); }; | ||
sha512.with_b64pad = function (b64pad) { | ||
sha512.crypt = function (input, salt) { return delegate.sha512crypt(input, salt); }; | ||
sha512.hex = function (input) { return delegate.rstr2hex(delegate.rstr_sha512(delegate.str2rstr_utf8(input))); }; | ||
sha512.base64 = function (input) { return delegate.rstr2b64(delegate.rstr_sha512(delegate.str2rstr_utf8(input))); }; | ||
sha512.any = function (input, alphabet) { return delegate.rstr2any(delegate.rstr_sha512(delegate.str2rstr_utf8(input)), alphabet); }; | ||
sha512.hexHmac = function (key, data) { return delegate.rstr2hex(delegate.rstr_hmac_sha512(delegate.str2rstr_utf8(key), delegate.str2rstr_utf8(data))); }; | ||
sha512.base64Hmac = function (key, data) { return delegate.rstr2b64(delegate.rstr_hmac_sha512(delegate.str2rstr_utf8(key), delegate.str2rstr_utf8(data))); }; | ||
sha512.anyHmac = function (key, data, alphabet) { return delegate.rstr2any(delegate.rstr_hmac_sha512(delegate.str2rstr_utf8(key), delegate.str2rstr_utf8(data)), alphabet); }; | ||
function setBase64Padding(b64pad) { | ||
delegate.b64pad = b64pad || ''; | ||
return sha512; | ||
}; | ||
sha512.with_hexcase = function (uppercase) { | ||
} | ||
sha512.setBase64Padding = setBase64Padding; | ||
function setHexCase(uppercase) { | ||
delegate.hexcase = uppercase ? 1 : 0; | ||
return sha512; | ||
}; | ||
} | ||
sha512.setHexCase = setHexCase; | ||
})(sha512 = exports.sha512 || (exports.sha512 = {})); |
{ | ||
"name": "sha512-crypt-ts", | ||
"version": "0.0.19", | ||
"version": "0.1.0", | ||
"description": "Typescript wrapper for SHA-512, including $6$ crypt format.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -22,5 +22,5 @@ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) | ||
``` | ||
sha512.sha512crypt('password', 'saltsalt'); | ||
sha512.crypt('password', 'saltsalt'); | ||
// Returns $6$saltsalt$qFmFH.bQmmtXzyBY0s9v7Oicd2z4XSIecDzlB5KiA2/jctKu9YterLp8wwnSq.qc.eoxqOmSuNp2xS0ktL3nh/ | ||
``` | ||
Another examples can be found in [unit tests](https://github.com/bedlaj/sha512-crypt-ts/blob/master/tests/sha512.test.ts) or in peer project [bedlaj/unifi-reset-password](https://github.com/bedlaj/unifi-reset-password/blob/master/src/app/app.component.ts). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26126