async function createHash(algorithm, data) {
    const hashAlgorithm = algorithmToHashAlgorithm[algorithm];
    if (!hashAlgorithm) {
        throw new Error(`Invalid algorithm ${algorithm} passed to createHash. Supported algorithms: ${Object.keys(algorithmToHashAlgorithm).join(", ")}`);
    }
    const hash = cryptoCreateHash(hashAlgorithm);
    hash.update(Buffer.from(data));
    const digest = hash.digest();
    return digest;
}
/**
 * @internal
 * Use the platform-local hashing functionality
 */
@internal
Use the platform-local hashing functionality
@internal Use the platform - local hashing functionality
async function createHash(algorithm, data) {
    const hashAlgorithm = algorithmToHashAlgorithm[algorithm];
    if (!hashAlgorithm) {
        throw new Error(`Invalid algorithm ${algorithm} passed to createHash. Supported algorithms: ${Object.keys(algorithmToHashAlgorithm).join(", ")}`);
    }
    const hash = cryptoCreateHash(hashAlgorithm);
    hash.update(Buffer.from(data));
    const digest = hash.digest();
    return digest;
}
async function createHash ( algorithm , data ) { const hashAlgorithm = algorithmToHashAlgorithm [ algorithm ] ; if ( ! hashAlgorithm ) { throw new Error ( ` ${ algorithm } ${ Object . keys ( algorithmToHashAlgorithm ) . join ( ", " ) } ` ) ; } const hash = cryptoCreateHash ( hashAlgorithm ) ; hash . update ( Buffer . from ( data ) ) ; const digest = hash . digest ( ) ; return digest ; }
@internal
 Use the platform-local hashing functionality
@internal Use the platform - local hashing functionality