func RefBlockPrefix(blockID string) (types.UInt32, error) {
	// Block ID is hex-encoded.
	rawBlockID, err := hex.DecodeString(blockID)
	if err != nil {
		return 0, errors.Wrapf(err, "networkbroadcast: failed to decode block ID: %v", blockID)
	}

	// Raw prefix = raw block ID [4:8].
	// Make sure we don't trigger a slice bounds out of range panic.
	if len(rawBlockID) < 8 {
		return 0, errors.Errorf("networkbroadcast: invalid block ID: %v", blockID)
	}
	rawPrefix := rawBlockID[4:8]

	// Decode the prefix.
	var prefix uint32
	if err := binary.Read(bytes.NewReader(rawPrefix), binary.LittleEndian, &prefix); err != nil {
		return 0, errors.Wrapf(err, "networkbroadcast: failed to read block prefix: %v", rawPrefix)
	}

	// Done, return the prefix.
	return types.UInt32(prefix), nil
}
//RefBlockPrefix function returns block prefix
RefBlockPrefix function returns block prefix
// RefBlockPrefix function returns block prefix
func RefBlockPrefix(blockID string) (types.UInt32, error) {
	rawBlockID, err := hex.DecodeString(blockID)
	if err != nil {
		return 0, errors.Wrapf(err, "networkbroadcast: failed to decode block ID: %v", blockID)
	}
	if len(rawBlockID) < 8 {
		return 0, errors.Errorf("networkbroadcast: invalid block ID: %v", blockID)
	}
	rawPrefix := rawBlockID[4:8]
	var prefix uint32
	if err := binary.Read(bytes.NewReader(rawPrefix), binary.LittleEndian, &prefix); err != nil {
		return 0, errors.Wrapf(err, "networkbroadcast: failed to read block prefix: %v", rawPrefix)
	}
	return types.UInt32(prefix), nil
}
func RefBlockPrefix ( blockID string ) ( types . UInt32 , error ) { rawBlockID , err := hex . DecodeString ( blockID ) if err != nil { return 0 , errors . Wrapf ( err , " " , blockID ) } if len ( rawBlockID ) < 8 { return 0 , errors . Errorf ( " " , blockID ) } rawPrefix := rawBlockID [ 4 : 8 ] var prefix uint32 if err := binary . Read ( bytes . NewReader ( rawPrefix ) , binary . LittleEndian , & prefix ) ; err != nil { return 0 , errors . Wrapf ( err , " " , rawPrefix ) } return types . UInt32 ( prefix ) , nil }
RefBlockPrefix function returns block prefix
RefBlockPrefix function returns block prefix
// Block ID is hex-encoded. // Raw prefix = raw block ID [4:8]. // Make sure we don't trigger a slice bounds out of range panic. // Decode the prefix. // Done, return the prefix.