Permalink
Browse files

Add example and setup to README.md

  • Loading branch information...
1 parent b808d83 commit 2594e652d9dfb8ede48f6d44f079a45884101eb2 @speps committed Sep 22, 2012
Showing with 23 additions and 2 deletions.
  1. +23 −2 README.md
View
@@ -1,7 +1,28 @@
go-hashids
==========
-Go (golang) implementation of http://www.hashids.org
+Go (golang) v1 implementation of http://www.hashids.org
under MIT License (same as the original implementations)
-Original implementations by Ivan Akimov at https://github.com/ivanakimov/hashids.php
+Original implementations by ivanakimov
+
+### Setup
+<pre>go get github.com/speps/go-hashids</pre>
+
+### Example
+```go
+package main
+
+import "fmt"
+import "github.com/speps/go-hashids"
+
+func main() {
+ h := hashids.New()
+ h.Salt = "this is my salt"
+ h.MinLength = 30
+ e := h.Encrypt([]int{45, 434, 1313, 99})
+ fmt.Println(e)
+ d := h.Decrypt(e)
+ fmt.Println(d)
+}
+```

0 comments on commit 2594e65

Please sign in to comment.