BREAKING CHANGE(core): switch to esm
This commit is contained in:
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smarthash',
|
||||
version: '3.0.0',
|
||||
description: 'simplified access to node hash functions'
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './nodehash.plugins';
|
||||
import * as plugins from './nodehash.plugins.js';
|
||||
|
||||
export * from './nodehash.sha256';
|
||||
export * from './nodehash.md5';
|
||||
export * from './nodehash.sha256.js';
|
||||
export * from './nodehash.md5.js';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './nodehash.plugins';
|
||||
import * as plugins from './nodehash.plugins.js';
|
||||
|
||||
export const hashStreamPipeStop = (resolveFuntion) => {
|
||||
const forEach = (chunk: Buffer, enc, cb) => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './nodehash.plugins';
|
||||
import * as plugins from './nodehash.plugins.js';
|
||||
|
||||
export const md5FromString = async (stringToHash: string) => {
|
||||
return plugins.crypto.createHash('md5').update(stringToHash).digest('hex');
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from './nodehash.plugins';
|
||||
import * as helpers from './nodehash.helpers';
|
||||
import * as plugins from './nodehash.plugins.js';
|
||||
import * as helpers from './nodehash.helpers.js';
|
||||
|
||||
/**
|
||||
* creates sha256 Hash from Stream
|
||||
@ -56,7 +56,7 @@ export const sha256FromBuffer = async (bufferArg: Buffer): Promise<string> => {
|
||||
* computes sha265 Hash from Object
|
||||
*/
|
||||
export const sha265FromObject = async (objectArg: any): Promise<string> => {
|
||||
const stringifiedObject = plugins.smartjson.stringify(objectArg, {});
|
||||
const stringifiedObject = plugins.smartjson.stringify(objectArg);
|
||||
const hashResult = await sha256FromString(stringifiedObject);
|
||||
return hashResult;
|
||||
};
|
||||
|
Reference in New Issue
Block a user