Compare Hex to Decimal

Michael Kennedy michael at
Fri Apr 13 15:42:29 UTC 2018


I have a URL that contains a Unix hex timestamp (something like 5ace8c5d). The timestamp should be within X minutes of now, and is used as part of an access control mechanism. I want to do something like this:

if (std.time(req.http.x-hextime, now) < now - 1w) {

Is there an efficient way in VCL to either convert Hex to Dec so that this comparison can be done, or some other solution that does not involve changing the data in the URL.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list