Documentation ¶
Index ¶
- Variables
- func AesDecrypt(ciphertext string, privateKey string, publicKey string) (string, error)
- func AesEncrypt(content string, privateKey string, publicKey string) (string, error)
- func AtPages(content string) ([]string, string)
- func AtPagesGetImages(content string) ([]string, string)
- func AtUsers(content string) (usrs []string)
- func Base64Encoding(s string) string
- func C2C(fromstr string, tostr string, str string) string
- func CheckEmail(email string) (b bool)
- func CheckPassword(password string) (b bool)
- func CheckUsername(username string) (b bool)
- func CompareDiff(fg1, fg2 string) int
- func ContainsSets(values []string, ivalue string) bool
- func Convzh(str string, lang string) []byte
- func DelLostImages(oldz string, newz string)
- func DifferenceSets(a []string, b []string) []string
- func Encrypt_hash(password string, salt []byte) string
- func Exist(filename string) bool
- func Filehash(path_or string, file_or *os.File) (string, error)
- func Filehash_block(path string, block int64) string
- func Filehash_number(path string) (int, error)
- func FixedpathByNumber(n int, layer int) string
- func FixedpathByString(s string, layer int) string
- func Fixurl(current_url, url string) string
- func GetBanner(content string) (string, error)
- func GetBannerThumbnail(content string) (string, error)
- func GetFile(file_url string, file_path string, useragent string, referer string) error
- func GetImagePha(path string) (string, error)
- func GetImages(content string) (imgs []string, num int)
- func GetPage(url string) (string, error)
- func GetSensitiveInfoRemovedEmail(email string) string
- func GetThumbnails(content string) (thumbnails string, thumbnailslarge string, thumbnailsmedium string, ...)
- func Gravatar(email string, height int) string
- func Hotness(ups int64, downs int64, createTime time.Time) float64
- func Hotness_Score(ups int64, downs int64) int64
- func Html2str(html string) string
- func Htmlquote(text string) string
- func Htmlunquote(text string) string
- func IntersectionSets(fora []string, forb []string) []string
- func IsLocal(path string) bool
- func IsSpider(userAgent string) bool
- func Local2url(path string) string
- func MD5(s string) string
- func MD5_16(s string) string
- func MakeThumbnails(localpath string) (thumbnails string, thumbnailslarge string, thumbnailsmedium string, ...)
- func Markdown(md string) template.HTML
- func Markdown2Text(md string) string
- func Metric(n int64) string
- func MoveFile(frompath string, topath string) error
- func Nrand(n int64) float64
- func PHA(m image.Image) string
- func Pages(results_count int, page int, pagesize int) (pages int, pageout int, beginnum int, endnum int, offset int)
- func Pagesbar(url string, keyword string, results_max int, pages int, page int, beginnum int, ...) (output template.HTML)
- func PhaCompare(path1 string, path2 string) (int, error)
- func PingFile(url string) bool
- func PostFile(filepath string, actionurl string, fieldname string) (*http.Response, error)
- func Qhot(Qviews int64, Qanswers int64, Qscore int64, Ascores int64, Created time.Time, ...) float64
- func Qhot_AScore(ups int64, downs int64) int64
- func Qhot_QScore(ups int64, downs int64) int64
- func Qhot_Vote(ups int64, downs int64) int64
- func RangeRand(n int) int
- func ReceivingPackets(decrypt bool, hash string, status string, content []byte, aesPublicKey string, ...) ([]byte, error)
- func Resample(m image.Image, r image.Rectangle, w, h int) image.Image
- func Resize(m image.Image, r image.Rectangle, w, h int) image.Image
- func Rex(text string, iregexp string) (b bool)
- func Round(val float64, prec int) float64
- func RsaDecrypt(ciphertext []byte, privateKey []byte) ([]byte, error)
- func RsaEncrypt(origData []byte, publicKey []byte) ([]byte, error)
- func S2T(str string) string
- func SHA1(s string) string
- func SendMail(user, password, host, to, subject, body, mailtype string) error
- func SendingPackets(encrypt bool, status string, actionurl string, content string, aesKey string, ...) (*http.Response, error)
- func SetSuffix(content string, str string) string
- func SmcTimeSince(timeAt time.Time) string
- func Str2Ans(str string) int64
- func Str2html(raw string) template.HTML
- func StrLen(str string) int64
- func StrOne(str string, where int64) string
- func StrPos(str string, sep string) int64
- func StringNewRand(len int) string
- func StringNewUUID() string
- func StringToUTF16(s string) []uint16
- func Substr(str string, start, length int, symbol string) string
- func SymmetricDifferenceSets(fora []string, forb []string) []string
- func T2S(str string) string
- func Tags(content string, str string) []string
- func ThisDate() time.Time
- func ThisHour() time.Time
- func ThisMonth() time.Time
- func ThisWeek() time.Time
- func ThisYear() time.Time
- func Thumbnail(mode string, input_file string, output_file string, output_size string, ...) error
- func TimeSince(created time.Time) string
- func UnionSets(fora []string, forb []string) []string
- func Url2local(path string) string
- func Validate_hash(hashed string, input_password string) bool
- func VerifyUserfile(path string, usr string) bool
- func Watermark(watermark_file string, input_file string, output_file string, ...) error
- func WriteFile(path string, filename string, content string) error
Constants ¶
This section is empty.
Variables ¶
var ( RsaPublicKey = []byte(` -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZsfv1qscqYdy4vY+P4e3cAtmv ppXQcRvrF1cB4drkv0haU24Y7m5qYtT52Kr539RdbKKdLAM6s20lWy7+5C0Dgacd wYWd/7PeCELyEipZJL07Vro7Ate8Bfjya+wltGK9+XNUIHiumUKULW4KDx21+1NL AUeJ6PeW+DAkmJWF6QIDAQAB -----END PUBLIC KEY----- `) RsaPrivateKey = []byte(` -----BEGIN RSA PRIVATE KEY----- MIICXQIBAAKBgQDZsfv1qscqYdy4vY+P4e3cAtmvppXQcRvrF1cB4drkv0haU24Y 7m5qYtT52Kr539RdbKKdLAM6s20lWy7+5C0DgacdwYWd/7PeCELyEipZJL07Vro7 Ate8Bfjya+wltGK9+XNUIHiumUKULW4KDx21+1NLAUeJ6PeW+DAkmJWF6QIDAQAB AoGBAJlNxenTQj6OfCl9FMR2jlMJjtMrtQT9InQEE7m3m7bLHeC+MCJOhmNVBjaM ZpthDORdxIZ6oCuOf6Z2+Dl35lntGFh5J7S34UP2BWzF1IyyQfySCNexGNHKT1G1 XKQtHmtc2gWWthEg+S6ciIyw2IGrrP2Rke81vYHExPrexf0hAkEA9Izb0MiYsMCB /jemLJB0Lb3Y/B8xjGjQFFBQT7bmwBVjvZWZVpnMnXi9sWGdgUpxsCuAIROXjZ40 IRZ2C9EouwJBAOPjPvV8Sgw4vaseOqlJvSq/C/pIFx6RVznDGlc8bRg7SgTPpjHG 4G+M3mVgpCX1a/EU1mB+fhiJ2LAZ/pTtY6sCQGaW9NwIWu3DRIVGCSMm0mYh/3X9 DAcwLSJoctiODQ1Fq9rreDE5QfpJnaJdJfsIJNtX1F+L3YceeBXtW0Ynz2MCQBI8 9KP274Is5FkWkUFNKnuKUK4WKOuEXEO+LpR+vIhs7k6WQ8nGDd4/mujoJBr5mkrw DPwqA3N5TMNDQVGv8gMCQQCaKGJgWYgvo3/milFfImbp+m7/Y3vCptarldXrYQWO AQjxwc71ZGBFDITYvdgJM1MTqc8xQek1FXn1vfpy2c6O -----END RSA PRIVATE KEY----- `) AesKey = "jjsdj#$827gfgh38dakljzmknghsj#2k" //32位 AesPublicKey = "akljzmknm.ahkjkl" //16位 )
Functions ¶
func AesDecrypt ¶
AES解密
func AesEncrypt ¶
AES加密
func AtPagesGetImages ¶
func Base64Encoding ¶
func CheckEmail ¶
func CheckPassword ¶
func CheckUsername ¶
func ContainsSets ¶
func DelLostImages ¶
func Encrypt_hash ¶
func Filehash_block ¶
func Filehash_number ¶
func FixedpathByNumber ¶
func FixedpathByString ¶
func GetBannerThumbnail ¶
func GetThumbnails ¶
func Htmlunquote ¶
func MD5 ¶
对字符串进行md5哈希, 返回32位小写md5结果
func MD5(s string) string { h := md5.New() io.WriteString(h, s) return fmt.Sprintf("%x", h.Sum(nil)) }
func MakeThumbnails ¶
func Markdown2Text ¶
func Pages ¶
func Pages(results_count int, page int, pagesize int) (pages int, pageout int, beginnum int, endnum int, offset int)
分页计算函数
func Qhot_AScore ¶
func Qhot_QScore ¶
func ReceivingPackets ¶
func Resample ¶
重新取样返回一个重采样本的图像切片r的副本。 返回的图像具有宽度w和高度h。 Resample returns a resampled copy of the image slice r of m. The returned image has width w and height h.
func Resize ¶
调整传回的图像片的R米的缩放副本。 返回的图像具有宽度w和高度h。 Resize returns a scaled copy of the image slice r of m. The returned image has width w and height h.
func SendMail ¶
* * user : example@example.com login smtp server user * password: xxxxx login smtp server password * host: smtp.example.com:port smtp.163.com:25 * to: example@example.com;example1@163.com;example2@sina.com.cn;... * subject:The subject of mail * body: The content of mail * mailtype: mail type html or text
func SendingPackets ¶
func SendingPackets(encrypt bool, status string, actionurl string, content string, aesKey string, aesPublicKey string, rsaPublicKey []byte) (*http.Response, error)
发送报文 是否加密 HTTP状态 动作URL 数据内容 RSA公匙
func SmcTimeSince ¶
func StringNewRand ¶
func SymmetricDifferenceSets ¶
对称差=并集-交集 即是 并集和交集的差集就是对称差
func Thumbnail ¶
func Thumbnail(mode string, input_file string, output_file string, output_size string, output_align string, background string) error
#gravity可用值有九个,分别是:
西北方 NorthWest:左上角为坐标原点,x轴从左到右,y轴从上到下,也是默认值。 北方 North:上部中间位置为坐标原点,x轴从左到右,y轴从上到下。 东北方 NorthEast:右上角位置为坐标原点,x轴从右到左,y轴从上到下。 西方 West:左边缘中间位置为坐标原点,x轴从左到右,y轴从上到下。 中央 Center:正中间位置为坐标原点,x轴从左到右,y轴从上到下。 东方 East:右边缘的中间位置为坐标原点,x轴从右到左,y轴从上到下。 西南方 SouthWest:左下角为坐标原点,x轴从左到右,y轴从下到上。 南方 South:下边缘的中间为坐标原点,x轴从左到右,y轴从下到上。 东南方 SouthEast:右下角坐标原点,x轴从右到左,y轴从下到上。
func Validate_hash ¶
func VerifyUserfile ¶
Types ¶
This section is empty.