import { fromUtf8 } from '@aws-sdk/util-utf8-browser' ; import { getWebCryptoBackend , getNonZeroByteBackend , } from '@aws-crypto/web-crypto-backend' ; import { concatBuffers } from '@aws-crypto/serialize' ; export const sha512 = async ( ... inputs ) => { const data = concatBuffers ( ... inputs . map ( ( u ) => ( typeof u === 'string' ? fromUtf8 ( u ) : u ) ) ) ; const backend = getNonZeroByteBackend ( await getWebCryptoBackend ( ) ) ; const ab = await backend . digest ( 'SHA-512' , data ) ; return new Uint8Array ( ab ) ; } ;