public static String getQRCode ( String name , String issuer , String secret , HmacShaAlgorithm algorithm , String digits , String period ) { Objects . requireNonNull ( name , Required . ACCOUNT_NAME . toString ( ) ) ; Objects . requireNonNull ( secret , Required . SECRET . toString ( ) ) ; Objects . requireNonNull ( issuer , Required . ISSUER . toString ( ) ) ; Objects . requireNonNull ( algorithm , Required . ALGORITHM . toString ( ) ) ; Objects . requireNonNull ( digits , Required . DIGITS . toString ( ) ) ; Objects . requireNonNull ( period , Required . PERIOD . toString ( ) ) ; var buffer = new StringBuilder ( ) ; buffer . append ( "https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=200x200&chld=M|0&cht=qr&chl=" ) . append ( getOtpauthURL ( name , issuer , secret , algorithm , digits , period ) ) ; return buffer . toString ( ) ; }
Generates a QR code to share a secret with a user