Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[addons] add callback function to get the MD5 digest of the given text #12204

Merged
merged 1 commit into from
Jun 7, 2017

Conversation

AlwinEsch
Copy link
Member

Description

Is needed on my test on GUI addon callbacks.

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the Code guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my change
  • All new and existing tests passed

@AlwinEsch AlwinEsch added this to the L 18.0-alpha1 milestone May 30, 2017
@AlwinEsch
Copy link
Member Author

jenkins build this please

@akva2
Copy link
Contributor

akva2 commented May 30, 2017

Kodi is not a complete toolbox for everything needed by addons. kodiplatform was invented for stuff like this as there is no interaction with kodi needed.

@AlwinEsch
Copy link
Member Author

@akva2 I understand you but in this case it is acceptable for me to have from Kodi.

Reasons are:

  • It is only one function used, in case the whole class for them or something other becomes used makes it also no sense for me and is really better to have in kodiplatform.
  • One another reason for me is to have it so simple as possible for addon developer. On Python addons can it be easily used with https://docs.python.org/2/library/md5.html and only add the line import md5 for C++ is it more complicated with add of external libraries.

@AlwinEsch
Copy link
Member Author

AlwinEsch commented May 31, 2017

My current requests are primary to bring in a new way for inputstream addons to allow encrypted streams. But want to have it also predefined as a basic framework for other languages in future.

@akva2
Copy link
Contributor

akva2 commented May 31, 2017

it's a slippery slope and i would hold the principles high in this case. but it's not my call to make.

btw, the idea was to make kodi a consumer of kodiplatform. most generic utils in xbmc/utils would go there. that way all this code is available to kodi and its add-ons, and there is only a single version to maintain.

/// #include <kodi/General.h>
/// ...
/// std::string md5 = kodi::GetMD5("Make me as md5");
/// fprintf(stderr, "My md5 digest is: '%s'\n", md5.c_str());

This comment was marked as spam.

///
inline std::string GetMD5(const std::string& text)
{
char* md5ret = static_cast<char*>(malloc(40*sizeof(char))); // md5 size normally 32 bytes

This comment was marked as spam.

@AchimTuran
Copy link
Member

@akva2

btw, the idea was to make kodi a consumer of kodiplatform. most generic utils in xbmc/utils would go there. that way all this code is available to kodi and its add-ons, and there is only a single version to maintain.

This sounds like a good way to go. So there would be no effort to maintain the callbacks. But this is not my call too as I don't have the huge overview like you both.
I also think moving this code to kodiplatform could be done later.

@ksooo
Copy link
Member

ksooo commented Jun 4, 2017

What @AchimTuran said.

@AlwinEsch
Copy link
Member Author

jenkins build this please

@AlwinEsch AlwinEsch merged commit 6925568 into xbmc:master Jun 7, 2017
@AlwinEsch AlwinEsch deleted the add_function branch June 7, 2017 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants