import {Sha256} from '@aws-crypto/sha256-js';

export const sha256 = async (message) => {
  const hash = new Sha256(message);
  const digest = await hash.digest();

  let result = '';
  digest.forEach((byte) => {
    result += byte.toString(16).padStart(2, '0');
  });
  return result;
};
