Changes

Jump to navigation Jump to search
306 bytes added ,  00:20, 16 April 2011
no edit summary
</entry>
</pre>
 
== IP-Converter ==
 
This snippet converts an IP address to its numeric representation:
 
<pre class="brush:xquery">
let $ip := '134.34.226.65'
return fold-left(
function($n, $d) { 256 * $n + $d },
0,
map(xs:integer#1, tokenize($ip, '\.'))
)
</pre>
results in
<pre class="brush:xml">
2250433089
</pre>
 
 
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
12,953

edits

Navigation menu