mirror of
https://gitee.com/johng/gf.git
synced 2024-12-05 05:37:55 +08:00
26 lines
450 B
Go
26 lines
450 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/crypto/gaes"
|
|
"github.com/gogf/gf/os/gfile"
|
|
"github.com/gogf/gf/os/gres"
|
|
)
|
|
|
|
var (
|
|
CryptoKey = []byte("x76cgqt36i9c863bzmotuf8626dxiwu0")
|
|
)
|
|
|
|
func main() {
|
|
binContent, err := gres.Pack("public,config")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
binContent, err = gaes.Encrypt(binContent, CryptoKey)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if err := gfile.PutBytes("data.bin", binContent); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|