Skip to content

Instantly share code, notes, and snippets.

@tav
Created December 29, 2011 19:41
Show Gist options
  • Save tav/1535871 to your computer and use it in GitHub Desktop.
Save tav/1535871 to your computer and use it in GitHub Desktop.
# Public Domain (-) 2011 The Togethr Authors.
# See the Togethr UNLICENSE file for details.
define 'togethr', (exports, root) ->
lookup = []
for base in exports.DIGITS_BASES
for c in [base...(base+10)]
lookup[c] = '' + (c - base)
exports.normaliseDigits = (s) ->
(lookup[s.charCodeAt(i)] for i in [0...s.length]).join ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment