bcrypt.inc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* The MIT License (MIT)
  2. * Copyright (c) 2014 Lassi R.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. * this software and associated documentation files (the "Software"), to deal in
  6. * the Software without restriction, including without limitation the rights to
  7. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  8. * of the Software, and to permit persons to whom the Software is furnished to do
  9. * so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in all
  12. * copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. #if defined bcrypt_included
  23. #endinput
  24. #endif
  25. #define bcrypt_included
  26. #define BCRYPT_HASH_LENGTH 61
  27. #define BCRYPT_PLUGIN_VERSION "2.2.4"
  28. enum BCRYPT_DEBUG_LEVEL {
  29. BCRYPT_LOG_FATAL,
  30. BCRYPT_LOG_ERROR,
  31. BCRYPT_LOG_WARNING,
  32. BCRYPT_LOG_INFO,
  33. BCRYPT_LOG_DEBUG,
  34. BCRYPT_LOG_TRACE
  35. }
  36. native bcrypt_hash(key[], cost = 12, callback_name[], callback_format[] = "", {Float, _}:...);
  37. native bcrypt_check(password[], hash[], callback_name[], callback_format[] = "", {Float, _}:...);
  38. native bcrypt_get_hash(dest[]);
  39. native bool:bcrypt_is_equal();
  40. native bool:bcrypt_needs_rehash(hash[], cost);
  41. native bcrypt_find_cost(time_target = 250);
  42. native bcrypt_set_thread_limit(value);
  43. native bcrypt_debug(BCRYPT_DEBUG_LEVEL:level = BCRYPT_LOG_ERROR);