mirror of
https://github.com/jimeh/node-base58.git
synced 2026-02-19 07:36:40 +00:00
Enable string value to be passed to Base58.encode()
This commit is contained in:
@@ -5,6 +5,7 @@ class Base58Builder
|
||||
|
||||
encode: (num) ->
|
||||
throw new Error('Value passed is not an integer.') unless /^\d+$/.test num
|
||||
num = parseInt(num) unless typeof num == 'number'
|
||||
str = ''
|
||||
while num >= @base
|
||||
mod = num % @base
|
||||
|
||||
Reference in New Issue
Block a user