fix(core): update

This commit is contained in:
2021-03-01 01:26:55 +00:00
parent bf1b89a95a
commit 5a6ae2f083
3 changed files with 111 additions and 36 deletions

View File

@ -42,6 +42,16 @@ export const sha256FromString = async (stringArg: string): Promise<string> => {
return hashResult;
};
/**
* Computes sha256 Hash from String
*/
export const sha256FromBuffer = async (bufferArg: Buffer): Promise<string> => {
const hash = plugins.crypto.createHash('sha256');
hash.update(bufferArg);
const hashResult = hash.digest('hex');
return hashResult;
};
/**
* computes sha265 Hash from Object
*/