7 lines
227 B
JavaScript
7 lines
227 B
JavaScript
import { toUint8Array } from "@smithy/util-utf8";
|
|
export const stringHasher = (checksumAlgorithmFn, body) => {
|
|
const hash = new checksumAlgorithmFn();
|
|
hash.update(toUint8Array(body || ""));
|
|
return hash.digest();
|
|
};
|