(data []byte)
| 380 | } |
| 381 | |
| 382 | func decodeString(data []byte) (string, error) { |
| 383 | if len(data) < 64 { |
| 384 | return "", fmt.Errorf("data too short") |
| 385 | } |
| 386 | strLen := new(big.Int).SetBytes(data[32:64]).Int64() |
| 387 | if int64(len(data)) < 64+strLen { |
| 388 | return "", fmt.Errorf("data length mismatch") |
| 389 | } |
| 390 | strBytes := data[64 : 64+strLen] |
| 391 | return string(strBytes), nil |
| 392 | } |