PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/core/src/main/php/util/collections/MD5HashImplementation.class.php

http://github.com/xp-framework/xp-framework
PHP | 28 lines | 8 code | 3 blank | 17 comment | 0 complexity | df7aaddb0240d9dd3f2fc94aa15b1892 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /* This class is part of the XP framework
  3. *
  4. * $Id$
  5. */
  6. uses('util.collections.HashImplementation');
  7. /**
  8. * MD5
  9. *
  10. * @see php://md5
  11. * @see xp://util.collections.HashProvider
  12. * @test xp://net.xp_framework.unittest.util.collections.MD5HashImplementationTest:
  13. */
  14. class MD5HashImplementation extends Object implements HashImplementation {
  15. /**
  16. * Retrieve hash code for a given string
  17. *
  18. * @param string str
  19. * @return int hashcode
  20. */
  21. public function hashOf($str) {
  22. return '0x'.md5($str);
  23. }
  24. }
  25. ?>