Hide input string from stdin

Wyatt via Digitalmars-d digitalmars-d at puremagic.com
Mon May 23 08:56:14 PDT 2016


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


More information about the Digitalmars-d mailing list