Documentation
¶
Index ¶
- Constants
- func AesDecrypt(data, key, nonce []byte) ([]byte, error)
- func AesEncrypt(data, key, nonce []byte) ([]byte, error)
- func CalcSHA256(data []byte) (string, error)
- func CalcSha256Hash(datas ...[]byte) []byte
- func CopyFile(src, dist string) error
- func EncodePubkey(pubkey []byte, format uint16) string
- func EncryptFile(fpath string, key, nonce []byte) (string, error)
- func FillRandData(data []byte) error
- func FillZeroData(data []byte) error
- func GetAESKeyEncryptedWithECDH(sk *ecies.PrivateKey, pubkey []byte) ([]byte, []byte, error)
- func GetDataHash(data ...any) []byte
- func GetRandomBytes() ([]byte, error)
- func ParsingPublickey(address string) ([]byte, error)
- func RSRestore(outpath string, shardspath []string) error
- func ReedSolomon(file string, saveDir string) ([]string, error)
- func ReedSolomonWithHandle(file []byte, handle func([]byte) error) error
- func Remove0x(hex string) string
- func SignWithSecp256k1PrivateKey(sk *ecdsa.PrivateKey, data []byte) ([]byte, error)
- func SignedSR25519WithMnemonic(mnemonic string, msg string) ([]byte, error)
- func VerifySR25519WithPublickey(msg, sign, pubkey []byte) (bool, error)
- func VerifySecp256k1Sign(pubkey, data, sign []byte) bool
- func WriteFile(fpath string, data []byte) error
- type Archiver
Constants ¶
View Source
const ( MiB = 1024 * 1024 SEGMENT_SIZE = 32 * MiB FRAGMENT_SIZE = 8 * MiB FRAGMENTS_NUM = 4 PARITY_NUM = 8 )
View Source
const ( ARCHIVER_FORMAT_ZIP = "zip" ARCHIVER_FORMAT_TAR = "tar" ARCHIVER_FORMAT_TARGZ = "tar.gz" UNNAMED_FILENAME = "Unnamed" )
View Source
const ( MAINNET_FORMAT = 11331 TESTNET_FORMAT = 11330 )
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func CalcSHA256 ¶
func CalcSha256Hash ¶
func EncodePubkey ¶
func FillRandData ¶
func FillZeroData ¶
func GetDataHash ¶
func GetRandomBytes ¶
func ParsingPublickey ¶
func ReedSolomonWithHandle ¶
func SignWithSecp256k1PrivateKey ¶
func SignWithSecp256k1PrivateKey(sk *ecdsa.PrivateKey, data []byte) ([]byte, error)
func VerifySecp256k1Sign ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.