Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chalkers committed Feb 13, 2015
1 parent e2c0ca6 commit 2e73d68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Readme.md
Expand Up @@ -15,13 +15,17 @@ npm install base62

## Usage

### Default Character Set Example

```javascript
Base62 = require('base62')
Base62.encode(999) // 'g7'
Base62.decode('g7') // 999
```

The default character set is `0-9a-zA-Z`. This can updated to a custom character set. Naturally, it must be 62 characters long.
### Custom Character Set Example

The default character set is `0-9a-zA-Z`. This can be updated to a custom character set. Naturally, it must be 62 characters long.

Instead of the character set `0-9a-zA-Z` you want to use `0-9A-Za-z`, call the `setCharacterSet()` method on the Base62 object passing in the string `"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"`. Note that all characters must be unique.

Expand Down

0 comments on commit 2e73d68

Please sign in to comment.