wiki-server
Version:
A Federated Wiki Server
19 lines (15 loc) • 494 B
text/coffeescript
###
* Federated Wiki : Node Server
*
* Copyright Ward Cunningham and other contributors
* Licensed under the MIT license.
* https://github.com/fedwiki/wiki-server/blob/master/LICENSE.txt
###
# **random_id.coffee**
# Simple random hex generator, takes an optional number of
# chars that defaults to 16 and returns a random id.
random_id = (chars = 16) ->
[0...chars].map( ->
Math.floor(Math.random() * 16).toString(16)
).join('')
module.exports = random_id.random_id = random_id