Skip to content

Commit

Permalink
Add example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
prodrigestivill committed Dec 3, 2018
1 parent c887a1c commit 3ddedb4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ var id = hashids.encodeHex('507f1f77bcf86cd799439011'); // y42LW46J9luq3Xq9XMly
var hex = hashids.decodeHex(id); // 507f1f77bcf86cd799439011
```

**Encode bigint numbers:**

Useful if you want to encode [PostgreSQL](https://www.postgresql.org/)'s bigint. Note that currently pg javascript driver handles bigint as string since it's support is a current draft.

```javascript
var hashids = new Hashids();

var id = hashids.encodeBI('50374626472636434472463271'); // ww2Vn9oypBtv1PZ2Rpp
var hex = hashids.decodeBI(id); // 50374626472636434472463271
```

Pitfalls
-------

Expand Down

0 comments on commit 3ddedb4

Please sign in to comment.