package models

import (
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"net/url"
) func Sha1(query string, pri_key string) string {
key := []byte(pri_key)
mac := hmac.New(sha1.New, key)
mac.Write([]byte(query))
query = base64.StdEncoding.EncodeToString(mac.Sum(nil))
query = url.QueryEscape(query)
return query
}

  

golang sha1 signature的更多相关文章

  1. git “bad index file sha1 signature fatal: index file corrupt”错误

    在执行commit或revert等操作时,提示“bad index file sha1 signature fatal: index file corrupt”错误,导致操作失败.这是由于git的in ...

  2. 安装mysql警告 warning: mysql-community-server-5.7.19-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    摘自:https://www.cnblogs.com/royfans/p/7243641.html 红帽安装rpm安装MySQL时爆出警告: 警告:MySQL-server-5.5.46-1.linu ...

  3. warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY

    症状描述: 使用yum安装软件时报如下错误: warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NO ...

  4. git 出错 bad index file sha1 signature

    error: bad index file sha1 signature fatal: index file corrupt 解决方法:使用git命令执行: $ rm -f .git/index $ ...

  5. Linux安装rpm包时报错Header V3 DSA/SHA1 Signature, key ID 1d1e034b: NOKEY解决办法

    这是因为yum安装了旧版本的GPG key造成的,解决办法: rpm --import /etc/pki/rpm-gpg/RPM* Header V3 DSA/SHA1 Signature, key ...

  6. yum命令Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

    yum命令Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY 博客分类: linux   三种解决方案 我采取第三种方案解决的 第一种: linu ...

  7. warning: mysql-community-libs-5.7.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5

    1.错误描写叙述 [root@ mysql]# rpm -ivh mysql-community-libs-5.7.11-1.el7.x86_64.rpm warning: mysql-communi ...

  8. 警告:MySQL-server-5.6.26-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY

    警告:MySQL-server--.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY 错误:依赖检测失败: /usr/bin/ ...

  9. CentOS 安装MySQL(rpm)提示错误Header V3 DSA/SHA1 Signature

    提示错误:Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies 错误原因:这是由于yum安装了 ...

随机推荐

  1. CDZSC_2015寒假新人(1)——基础 f

    Description An inch worm is at the bottom of a well n inches deep. It has enough energy to climb u i ...

  2. php 函数 将数组转换成标量变量:extract()

    格式 extract( array var_array [, int extract_type] [,string prefix] ); 例子 $array4 = array('key1'=>' ...

  3. win32程序调试OutputDebugString 类似printf格式化输出

    有没有win32编程因为打印变量调试程序而头疼呢.方法二的函数完全类似printf.非常完美.方法一:不带参数输出如printf("hello world"); OutputDeb ...

  4. 引用JS表单验证大全 以后方便查看用

    1:js 字符串长度限制.判断字符长度 .js限制输入.限制不能输入.textarea 长度限制 2.:js判断汉字.判断是否汉字 .只能输入汉字 3:js判断是否输入英文.只能输入英文 4:js只能 ...

  5. ACboy needs your help again!--hdu1702

    ACboy needs your help again! Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ( ...

  6. TensorFlow 深度学习笔记 Stochastic Optimization

    Stochastic Optimization 转载请注明作者:梦里风林 Github工程地址:https://github.com/ahangchen/GDLnotes 欢迎star,有问题可以到I ...

  7. SQL 必备- ORACLE-SQSLSERVER-DB2时间函数及常见函数总结

    SQLSERVER 篇: 一.时间函数 --getdate 获取当前时间 select getdate() --dateadd 原有时间加: 2013-02-17 13:20:16 此时间加12个月 ...

  8. MVC 后台DataTable 前台遍历

    /// <summary> /// 多级审批流展示 /// </summary> /// <returns></returns> public Acti ...

  9. PHP简单socket编程

    今天再看一点邮件发送的功能,所以了解一下socket变成,看到了一篇不错的文章,转发过来做个笔记吧. 原文链接:http://www.cnblogs.com/thinksasa/archive/201 ...

  10. Ubuntu12.04 LTS Add Sources List

    1. First Step: sudo gedit /etc/apt/sources.list 2. Add Soures List Content: # deb cdrom:[Ubuntu LTS ...