

const require_CredoError = require('../../error/CredoError.js');
require('../../error/index.js');
const require_TypedArrayEncoder = require('../../utils/TypedArrayEncoder.js');
const require_Sha1 = require('./Sha1.js');
const require_Sha256 = require('./Sha256.js');
const require_Sha384 = require('./Sha384.js');
const require_Sha512 = require('./Sha512.js');
require('../../utils/index.js');

//#region src/crypto/hashes/Hasher.ts
var Hasher = class {
	static hash(data, hashName) {
		const dataInput = typeof data === "string" ? require_TypedArrayEncoder.TypedArrayEncoder.fromString(data) : data;
		switch (hashName.toUpperCase()) {
			case "SHA-512": return new require_Sha512.Sha512().hash(dataInput);
			case "SHA-384": return new require_Sha384.Sha384().hash(dataInput);
			case "SHA-256": return new require_Sha256.Sha256().hash(dataInput);
			case "SHA-1": return new require_Sha1.Sha1().hash(dataInput);
			default: throw new require_CredoError.CredoError(`Hash name: '${hashName}' is not supported.`);
		}
	}
};

//#endregion
exports.Hasher = Hasher;