
            const raw = atob(str);
            let result = '';
            for (let i = 0; i < raw.length; i++) {
                const hex = raw.charCodeAt(i).toString(16);
                result += (hex.length === 2 ? hex : '0' + hex);
            }
            return result.toLowerCase();
        }

        function hexToBytes(hex) {
            return Uint8Array.from(hex.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
        }

        function bytesToHex(bytes) {
            return bytes.reduce