Documentation ¶
Index ¶
- func ARToWinston(a *big.Float) *big.Int
- func Base64Decode(data string) ([]byte, error)
- func Base64Encode(data []byte) string
- func BundleItemSignData(d types.BundleItem) ([]byte, error)
- func ByteArrayToLong(b []byte) int
- func ConcatBuffer(buffers ...[]byte) []byte
- func ContainsInSlice(items []string, item string) bool
- func DecodeBlock(body string) (*types.Block, error)
- func DecodeBundle(bundleBinary []byte) (*types.Bundle, error)
- func DecodeBundleItem(itemBinary []byte) (*types.BundleItem, error)
- func DecodeBundleItemStream(itemBinary io.Reader) (*types.BundleItem, error)
- func DecodeBundleStream(bundleData *os.File) (*types.Bundle, error)
- func DeepHash(data []interface{}) [48]byte
- func DeserializeTags(data []byte) ([]types.Tag, error)
- func GenerateChunks(data interface{}) (types.Chunks, error)
- func GenerateIndepHash(b types.Block) string
- func GenerateItemBinary(d *types.BundleItem) (by []byte, err error)
- func GenerateItemBinaryStream(d *types.BundleItem) (binaryReader io.Reader, err error)
- func GenerateRsaKey(bits int) (*rsa.PrivateKey, error)
- func GetBundleItemTagsBytes(itemBinary []byte) ([]byte, error)
- func GetChunk(tx types.Transaction, idx int, data []byte) (*types.GetChunk, error)
- func GetChunkStream(tx types.Transaction, idx int, data *os.File) (*types.GetChunk, error)
- func GetSignatureData(tx *types.Transaction) ([]byte, error)
- func Hash(data [][]byte) []byte
- func ItemSignerAddr(b types.BundleItem) (string, error)
- func LongTo32ByteArray(long int) []byte
- func LongTo8ByteArray(long int) []byte
- func NewBundle(items ...types.BundleItem) (*types.Bundle, error)
- func NewBundleItem(owner string, signatureType int, target, anchor string, data []byte, ...) (*types.BundleItem, error)
- func NewBundleItemStream(owner string, signatureType int, target, anchor string, data io.Reader, ...) (*types.BundleItem, error)
- func NewBundleStream(items ...types.BundleItem) (*types.Bundle, error)
- func OwnerToAddress(owner string) (string, error)
- func OwnerToPubKey(owner string) (*rsa.PublicKey, error)
- func PaddedBigBytes(bigint *big.Int, n int) []byte
- func PrepareChunks(tx *types.Transaction, data interface{}, dataSize int) error
- func PstTransferTags(contractId string, target string, qty int64, warp bool) ([]types.Tag, error)
- func ReadBits(bigint *big.Int, buf []byte)
- func SerializeTags(tags []types.Tag) ([]byte, error)
- func ShortTo2ByteArray(long int) []byte
- func Sign(msg []byte, prvKey *rsa.PrivateKey) ([]byte, error)
- func SignTransaction(tx *types.Transaction, prvKey *rsa.PrivateKey) error
- func SubmitItemToArSeed(item types.BundleItem, currency, arseedUrl string) (*schema.RespOrder, error)
- func SubmitItemToBundlr(item types.BundleItem, bundlrUrl string) (*types.BundlrResp, error)
- func TagsDecode(base64Tags []types.Tag) ([]types.Tag, error)
- func TagsEncode(tags []types.Tag) []types.Tag
- func Verify(msg []byte, pubKey *rsa.PublicKey, sign []byte) error
- func VerifyBundleItem(d types.BundleItem) error
- func VerifyTransaction(tx types.Transaction) (err error)
- func WinstonToAR(w *big.Int) *big.Float
- type ValidateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func BundleItemSignData ¶
func BundleItemSignData(d types.BundleItem) ([]byte, error)
func ByteArrayToLong ¶
func ContainsInSlice ¶
ContainsInSlice checks if a string is in a slice of strings
func DecodeBundleItem ¶
func DecodeBundleItem(itemBinary []byte) (*types.BundleItem, error)
func DecodeBundleItemStream ¶
func DecodeBundleItemStream(itemBinary io.Reader) (*types.BundleItem, error)
func GenerateChunks ¶
*
- Generates the data_root, chunks & proofs
- needed for a transaction. *
- This also checks if the last chunk is a zero-length
- chunk and discards that chunk and proof if so.
- (we do not need to upload this zero length chunk) *
- @param data
func GenerateIndepHash ¶
func GenerateItemBinary ¶
func GenerateItemBinary(d *types.BundleItem) (by []byte, err error)
func GenerateItemBinaryStream ¶
func GenerateItemBinaryStream(d *types.BundleItem) (binaryReader io.Reader, err error)
func GenerateRsaKey ¶
func GenerateRsaKey(bits int) (*rsa.PrivateKey, error)
func GetBundleItemTagsBytes ¶
func GetChunkStream ¶
func GetSignatureData ¶
func GetSignatureData(tx *types.Transaction) ([]byte, error)
func ItemSignerAddr ¶
func ItemSignerAddr(b types.BundleItem) (string, error)
func LongTo32ByteArray ¶
func LongTo8ByteArray ¶
func NewBundleItem ¶
func NewBundleItemStream ¶
func NewBundleStream ¶
func NewBundleStream(items ...types.BundleItem) (*types.Bundle, error)
func OwnerToAddress ¶
func PrepareChunks ¶
func PrepareChunks(tx *types.Transaction, data interface{}, dataSize int) error
func PstTransferTags ¶
func SerializeTags ¶
using bundle tx, avro serialize
func ShortTo2ByteArray ¶
func SignTransaction ¶
func SignTransaction(tx *types.Transaction, prvKey *rsa.PrivateKey) error
func SubmitItemToArSeed ¶
func SubmitItemToBundlr ¶
func SubmitItemToBundlr(item types.BundleItem, bundlrUrl string) (*types.BundlrResp, error)
func VerifyBundleItem ¶
func VerifyBundleItem(d types.BundleItem) error
func VerifyTransaction ¶
func VerifyTransaction(tx types.Transaction) (err error)
Types ¶
type ValidateResult ¶
func ValidatePath ¶
func ValidatePath(id []byte, dest, leftBound, rightBound int, path []byte) (*ValidateResult, bool)
验证 merkle path
Click to show internal directories.
Click to hide internal directories.