Socket
Socket
Sign inDemoInstall

react-native-totp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-totp

A React Native module google Authenticator (TOTP)


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-totp

由谷歌TOTP两步认证动态验证码生成 google-authenticator 封装的 react-native 插件, 支持 Android 与 iOS

安装

react-native版本 < 0.60

  1. $ npm install react-native-totp --save
  2. $ react-native link react-native-totp

react-native版本 >= 0.60

  1. $ npm install react-native-totp --save
  2. cd ios && pod install

使用

options

参数类型默认必须详情
base32Stringstringbase32编码的字符串, 需与服务器端一致
digitsnumber6验证码位数, 默认6位, 需与服务器端一致
periodnumber60有效时间, 单位秒, 默认60秒, 需与服务器端一致
import RNTotp from 'react-native-totp';

RNTotp.generateOTP({
  base32String: 'R35AQPURMAHIO324',
}, (code) => {
  console.log('验证码是: ', code);
  alert(code);
});

Keywords

FAQs

Package last updated on 24 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc