Created
July 2, 2014 15:58
-
-
Save adamretter/1c99ae9b7eead99408e1 to your computer and use it in GitHub Desktop.
XQuery for Random hex string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(:~ | |
: Generates a string of random hex digits | |
: @author Adam Retter <[email protected]> | |
:) | |
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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
here's a live version: http://try.zorba.io/queries/xquery/4vQFWKa1qB8GTJbM0NE7YHf%2FKz4%3D