Skip to content

Instantly share code, notes, and snippets.

@dylanpyle
Created June 30, 2015 20:40
Show Gist options
  • Save dylanpyle/e998fa37e2c18a923968 to your computer and use it in GitHub Desktop.
Save dylanpyle/e998fa37e2c18a923968 to your computer and use it in GitHub Desktop.
$ go run test.go
laHquq
$ ruby test.rb
laHquq
$ node test.js
laHquq
$ cat test.go
package main
import(
"fmt"
"github.com/speps/go-hashids"
)
func main() {
hd := hashids.NewData()
hd.Salt = "this is my salt"
h := hashids.NewWithData(hd)
e, _ := h.Encode([]int{1, 2, 3})
fmt.Println(e)
}
$ cat test.rb
require 'hashids'
hashids = Hashids.new "this is my salt"
id = hashids.encode(1, 2, 3)
numbers = hashids.decode(id)
print id
$ cat test.js
var Hashids = require('hashids');
var hashids = new Hashids("this is my salt"),
id = hashids.encode(1, 2, 3);
console.log(id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment