import { promisify } from "node:util";
import { randomBytes, scrypt } from "node:crypto";
const MAX_UINT32 = 2 ** 32 - 1;
const MAX_UINT24 = 2 ** 24 - 1;
var RangeValidator = class {
	static validate(label, value, range) {
		if (typeof value !== "number" || !Number.isInteger(value)) throw new TypeError(`The "${label}" option must be an integer`);
		const [min, max] = range;
		if (value < min || value > max) throw new TypeError(`The "${label}" option must be in the range (${min} <= ${label} <= ${max})`);
	}
};
var EnumValidator = class {
	static validate(label, value, allowedValues) {
		if (!allowedValues.includes(value)) throw new TypeError(`The "${label}" option must be one of: ${allowedValues}`);
	}
};
const randomBytesAsync = promisify(randomBytes);
const scryptAsync = promisify(scrypt);
export { randomBytesAsync as a, RangeValidator as i, MAX_UINT24 as n, scryptAsync as o, MAX_UINT32 as r, EnumValidator as t };
