Skip to content

Instantly share code, notes, and snippets.

@mhinz
Created June 29, 2017 14:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mhinz/a65da4ecabbb783f555f39b2f5c1cfb5 to your computer and use it in GitHub Desktop.
Save mhinz/a65da4ecabbb783f555f39b2f5c1cfb5 to your computer and use it in GitHub Desktop.
function! RandNum() abort
return str2nr(matchstr(reltimestr(reltime()), '\.\zs\d*'))
endfunction
function! RandChar() abort
return nr2char((RandNum() % 93) + 33)
endfunction
function! Password() abort
return join(map(range(8), 'RandChar()'), '')
endfunction
echo Password()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment