passwd.go 446 B

123456789101112131415161718
  1. // Copyright 2019 autocareai.com. All rights reserved.
  2. // Use of this source code is governed by autocareai.com.
  3. package util
  4. import (
  5. "encoding/base64"
  6. "google.golang.org/grpc/status"
  7. )
  8. func GetMd5Pass(passwd,cryptoKey string) (string, error) {
  9. cryPasswd, err := AesEncrypt(passwd, cryptoKey)
  10. if err != nil {
  11. return "", status.Error(10003, "参数错误")
  12. }
  13. ret := MD5(base64.StdEncoding.EncodeToString(cryPasswd))
  14. return ret, nil
  15. }