

const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
const require_Sha256 = require('../../hashes/Sha256.js');
require('../../hashes/index.js');
let webcrypto_core = require("webcrypto-core");
webcrypto_core = require_rolldown_runtime.__toESM(webcrypto_core);

//#region src/crypto/webcrypto/providers/CredoSha256Provider.ts
var CredoSha256Provider = class extends webcrypto_core.ProviderCrypto {
	constructor(..._args) {
		super(..._args);
		this.name = "SHA-256";
		this.usages = [];
	}
	async onDigest(algorithm, data) {
		switch (algorithm.name.toUpperCase()) {
			case "SHA-256": return new require_Sha256.Sha256().hash(new Uint8Array(data)).buffer;
			default: throw new Error(`Hashing algorithm: ${JSON.stringify(algorithm)} is not supported`);
		}
	}
};

//#endregion
exports.CredoSha256Provider = CredoSha256Provider;