Skip to content
台灣身份證產生器,也可以驗證。
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example
tasks
README.md
bower.json
id.js
id.min.js

README.md

id.js

id.js 可以幫你產生台灣的身份證 或是 幫你驗證該身份證是否有效。 這是我的第一個 github 程式,歡迎大家使用 :) 若有任何問題,歡迎來信給 sexyoung Habuche@gmail.com

安裝

使用 bower 安裝:

bower install id.js

嵌入

在你的 html 裡使用:

<script src="id.min.js"></script>

使用

安裝好之後可以直接使用 id 物件來進行操作

產生身份證

id.make(object params)

// 直接產生
id.make();
=> 'A123456789'

// 指定第一位為 A ~ Z
id.make({area: 'E'});
=> 'E159242737'

// 指定性別: m or w
id.make({gender: 'w'});
=> 'T281887004'

// 同時指定 區域 與 性別
id.make({area: 'E',gender: 'w'});
=> 'E238403438'

id.valid(string id)

// 驗證正確時會回傳 true
id.valid('A123456789');
=> true

// 驗證不正確時會回傳 false
id.valid('this is fake.');  
=> false;

:)

Something went wrong with that request. Please try again.