项目作者: xandkar

项目描述 :
Google Authenticator URI constructor
高级语言: Erlang
项目地址: git://github.com/xandkar/erlang-google-authenticator-uri.git
创建时间: 2015-06-29T22:50:20Z
项目社区:https://github.com/xandkar/erlang-google-authenticator-uri

开源协议:MIT License

下载


Build Status

Google Authenticator URI constructor

Example:

  1. 1> rr(google_authenticator_uri).
  2. [google_authenticator_uri_params]
  3. 2>
  4. 2> ParamsTOTP = #google_authenticator_uri_params
  5. 2> { type = totp
  6. 2> , account_name = <<"dude@lebowski.io">>
  7. 2> , secret = <<"allDudesGoBowling">>
  8. 2> , issuer = {some, <<"TheBigLebowski">>}
  9. 2> },
  10. 2> UriTOTP = google_authenticator_uri:cons(ParamsTOTP),
  11. 2> io:format("~p~n", [UriTOTP]).
  12. <<"otpauth://totp/TheBigLebowski:dude@lebowski.io?secret=MFWGYRDVMRSXGR3PIJXXO3DJNZTQ%3D%3D%3D%3D&issuer=TheBigLebowski&algorithm=SHA1&digits=6&period=30">>
  13. ok
  14. 3>
  15. 3> ParamsHOTP = #google_authenticator_uri_params
  16. 3> { type = {hotp, {counter, 0}}
  17. 3> , account_name = <<"dude@lebowski.io">>
  18. 3> , secret = <<"allDudesGoBowling">>
  19. 3> , issuer = {some, <<"TheBigLebowski">>}
  20. 3> },
  21. 3> UriHOTP = google_authenticator_uri:cons(ParamsHOTP),
  22. 3> io:format("~p~n", [UriHOTP]).
  23. <<"otpauth://hotp/TheBigLebowski:dude@lebowski.io?secret=MFWGYRDVMRSXGR3PIJXXO3DJNZTQ%3D%3D%3D%3D&issuer=TheBigLebowski&algorithm=SHA1&digits=6&counter=0">>
  24. ok
  25. 4>