fix(core): update
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
import * as plugins from './nodehash.plugins';
|
||||
|
||||
export const hashStreamPipeStop = resolveFuntion => {
|
||||
export const hashStreamPipeStop = (resolveFuntion) => {
|
||||
const forEach = (chunk: Buffer, enc, cb) => {
|
||||
resolveFuntion(chunk.toString('utf8'));
|
||||
cb(null, chunk);
|
||||
};
|
||||
|
||||
const atEnd = cb => {
|
||||
const atEnd = (cb) => {
|
||||
cb();
|
||||
};
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
import * as plugins from './nodehash.plugins';
|
||||
|
||||
export const md5FromString = async (stringToHash: string) => {
|
||||
return plugins.crypto
|
||||
.createHash('md5')
|
||||
.update(stringToHash)
|
||||
.digest('hex');
|
||||
return plugins.crypto.createHash('md5').update(stringToHash).digest('hex');
|
||||
};
|
||||
|
@ -46,7 +46,7 @@ export const sha256FromString = async (stringArg: string): Promise<string> => {
|
||||
* computes sha265 Hash from Object
|
||||
*/
|
||||
export const sha265FromObject = async (objectArg: any): Promise<string> => {
|
||||
const stringifiedObject = plugins.smartjson.Smartjson.stringify(objectArg, {});
|
||||
const stringifiedObject = plugins.smartjson.stringify(objectArg, {});
|
||||
const hashResult = await sha256FromString(stringifiedObject);
|
||||
return hashResult;
|
||||
};
|
||||
|
Reference in New Issue
Block a user