From 5d92994bca4bab8cbd5f974cbe9506f9a976c1c5 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 3 Jun 2021 11:15:03 +0200 Subject: [PATCH] docs: add note about BCrypt hashes Related: https://github.com/socketio/socket.io-admin-ui/issues/9 --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 2779f73..ae4f55a 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,27 @@ instrument(io, { }); ``` +WARNING! Please note that the `bcrypt` package does not currently support hashes starting with the `$2y$` prefix, which is used by some BCrypt implementations (for example https://bcrypt-generator.com/ or https://www.bcrypt.fr/). You can check the validity of the hash with: + +``` +$ node +> require("bcrypt").compareSync("", "") +true +``` + +You can generate a valid hash with: + +``` +$ node +> require("bcrypt").hashSync("changeit", 10) +'$2b$10$LQUE...' +``` + +See also: + +- https://github.com/kelektiv/node.bcrypt.js/issues/849 +- https://stackoverflow.com/a/36225192/5138796 + #### `namespaceName` Default value: `/admin`