On Monday, 23 May 2016 at 15:56:14 UTC, Wyatt wrote:
On Sunday, 22 May 2016 at 22:38:46 UTC, Michael Chen wrote:
I tried to write a small program that receive string as password. However, I didn't find available library for hide input string, even in core library. Any suggestion?

For Linux, I think you could just use getpass() from core.sys.posix.unistd. Not sure what the Windows equivalent is. An agnostic, user-facing version isn't a terrible idea. Or arguably better, a good way to disable echo on stdin; maybe file a bug about this against std.stdio?

-Wyatt

Here's example `getpass` (in C++, but can be translated trivially) for Windows, using `SetConsoleMode` with turning off `ENABLE_ECHO_OUTPUT`.

http://www.cplusplus.com/articles/E6vU7k9E/#WIN-e1

Reply via email to