Skip to content

Instantly share code, notes, and snippets.

@adamretter
Created July 2, 2014 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamretter/1c99ae9b7eead99408e1 to your computer and use it in GitHub Desktop.
Save adamretter/1c99ae9b7eead99408e1 to your computer and use it in GitHub Desktop.
XQuery for Random hex string
(:~
: Generates a string of random hex digits
: @author Adam Retter <adam@exist-db.org>
:)
let $len := 20 (: how long a string to generate :)
return
codepoints-to-string(((1 to $len) ! util:random(16)) ! (.[. lt 10]+48, .[. ge 10]+87))
@wcandillon
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment