Dear Christian, Thanks for that, it did the trick. I am curious what I was doing wrong with the BigInteger attempt? Cheers, -carl
On Feb 13, 2014, at 7:10 AM, Christian GrĂ¼n christian.gruen@gmail.com wrote:
Hi Carl,
Any suggestions?
there may be several solutions; one of them looks as follows:
let $uuid := xs:hexBinary(translate(random:uuid(),'-','')) let $bytes := convert:binary-to-bytes($uuid) ! xs:decimal(if(. < 0) then .+256 else .) return fold-left($bytes, 0, function($a, $b) { $a * 256 + $b })
Hope this helps, Christian
Cheers, -carl
declare namespace BI = "java:java.math.BigInteger";
declare function uuid_oid() { let $uuid := translate(random:uuid(),'-','') let $bigInt := concat('2.25.',BI:new($uuid, xs:int(16) )) return $bigInt
};
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk