[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: hashing text in XSLT?
From: "Steve Ball steve.ball@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Oct 2026 01:17:54 -0000
Hi Graydon,

Yes, it can be done, without having to use v4.0 features.

It's tricky, and not perfect, because XPath can't do bit-level operations.

A few years ago I implemented a hash algorithm for XPath/XSLT using XPath 2.0 features (i.e. it uses the string-to-codepoints() function). It also uses some large (prime) numbers, such as 2^50, so you would need to run it on a 64-bit machine.

If you would like the code let me know. It needs a bit of a cleanup before I can share it.

Cheers,

Steve Ball


On 9/10/26 03:49, Graydon graydon@xxxxxxxxx wrote:
Hello!

Given an XSLT 3/XPath 3.1 processor (Saxon-J 12.9 in oXygen), is there a
practical way to hash strings?

I'd suppose there might be a Java function, but if so, I have no idea
what it is, and some searching sugguests hashing isn't a core function
thing.

Thanks!

Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member