go-hashids

Go (golang) implementation of http://www.hashids.org

  • 所有者: speps/go-hashids
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

go-hashids Build Status GoDoc

Go (golang) v1 implementation of http://www.hashids.org
under MIT License (same as the original implementations)

Original implementations by Ivan Akimov

Setup

CLI tool :

Example

package main

import "fmt"
import "github.com/speps/go-hashids"

func main() {
	hd := hashids.NewData()
	hd.Salt = "this is my salt"
	hd.MinLength = 30
	h, _ := hashids.NewWithData(hd)
	e, _ := h.Encode([]int{45, 434, 1313, 99})
	fmt.Println(e)
	d, _ := h.DecodeWithError(e)
	fmt.Println(d)
}

Thanks to all the contributors

Let me know if I forgot anyone of course.

Changelog

2017/05/09

  • Changed API
    • New methods now return errors
    • Added sanity check in Decode that makes sure that the salt is consistent

2014/09/13

  • Updated to Hashids v1.0.0 (should be compatible with other implementations, let me know if not, was checked against the Javascript version)
  • Changed API
    • Encrypt/Decrypt are now Encode/Decode
    • HashID is now constructed from HashIDData containing alphabet, salt and minimum length

主要指標

概覽
名稱與所有者speps/go-hashids
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2012-09-22 21:46:39
推送於2022-06-24 11:49:40
最后一次提交2021-05-04 18:47:04
發布數3
最新版本名稱v2.0.1 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數1.3k
關注者數15
派生數110
提交數84
已啟用問題?
問題數35
打開的問題數6
拉請求數19
打開的拉請求數3
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?