/* Socket Lib - Built with esbuild */
var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var c=(t,r)=>{for(var n in r)i(t,n,{get:r[n],enumerable:!0})},h=(t,r,n,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of a(r))!f.call(t,o)&&o!==n&&i(t,o,{get:()=>r[o],enumerable:!(e=s(r,o))||e.enumerable});return t};var u=t=>h(i({},"__esModule",{value:!0}),t);var m={};c(m,{hexToSsri:()=>b,isValidHex:()=>x,isValidSsri:()=>l,parseSsri:()=>$,ssriToHex:()=>g});module.exports=u(m);function g(t){const r=/^([a-z0-9]+)-([A-Za-z0-9+/]+=*)$/i.exec(t);if(!r||!r[2]||r[2].length<2)throw new Error(`Invalid SSRI format: ${t}`);const n=r[2];return Buffer.from(n,"base64").toString("hex")}function b(t,r="sha256"){if(!/^[a-f0-9]+$/i.test(t))throw new Error(`Invalid hex format: ${t}`);const e=Buffer.from(t,"hex").toString("base64");return`${r}-${e}`}function l(t){return/^[a-z0-9]+-[A-Za-z0-9+/]{2,}=*$/i.test(t)}function x(t){return/^[a-f0-9]+$/i.test(t)}function $(t){const r=/^([a-z0-9]+)-([A-Za-z0-9+/]+=*)$/i.exec(t);if(!r||!r[1]||!r[2]||r[2].length<2)throw new Error(`Invalid SSRI format: ${t}`);const n=r[1],e=r[2];return{algorithm:n,base64Hash:e}}0&&(module.exports={hexToSsri,isValidHex,isValidSsri,parseSsri,ssriToHex});
//# sourceMappingURL=ssri.js.map
