Coder Social home page Coder Social logo

verification-code's Introduction

verification-code

npm npm npm

前端随机生成验证码的小工具, 利用了前端中的 canvas 画布来进行数字的展示。

安装:

npm install --save-dev verification-code

开始使用:

import verification from 'verification-code';

var result = verification.create();
var vcode = result.code;				// 随机生成的验证码
var imgDataURL = result.dataURL;		// 验证码图片的 base64

效果:

verification-code's People

Contributors

f-happy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

verification-code's Issues

能否写几个详细的示例呢?完全不知从哪里下手,谢谢!

传统上,图形验证码是后台生成,在img标签上src属性指向一个动态生成图片的地址即可,刷新时就刷新这个地址,用前端的图形验证码生成优点是不用后台交互了,但这应该怎么用呢?
用img标签还是canvas标签?如果把生成的Base64数据显示为图片?如何刷新验证码呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.