util.go 314 B

123456789101112131415161718192021
  1. package util
  2. import (
  3. "app.yhyue.com/moapp/jybase/encrypt"
  4. )
  5. // 加密
  6. func EncodeId(sid string) string {
  7. if sid == "" {
  8. return ""
  9. }
  10. return encrypt.EncodeArticleId2ByCheck(sid)
  11. }
  12. // 解密
  13. func DecodeId(eid string) string {
  14. if eid == "" {
  15. return ""
  16. }
  17. return encrypt.DecodeArticleId2ByCheck(eid)[0]
  18. }