
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
github.com/PhilipTang/aliyun-id-ocr
Advanced tools
添加自己的产品密钥
vi idocr.go
// TODO 修改此处,使用配置文件
const APPCODE = "hehe"
类结构
▼ package
idocr
▼ imports
crypto/tls
encoding/base64
encoding/json
errors
fmt
github.com/golang/glog
io/ioutil
net/http
strings
▼ constants
+APPCODE
▼+IDOCR : struct
[fields]
+Address : string
+Birth : string
+EndDate : string
+Issue : string
+Name : string
+Nationality : string
+Num : string
+Sex : string
+StartDate : string
[methods]
+Back(base64img string) : error
+Face(base64img string) : error
-formatResult(input string) : aliDataValue, error
-post(img, face string) : string, error
[functions]
+GetIDCard(faceUrl, backUrl string) : IDOCR, error
-getIDCardOCR(imgFace, imgBack string) : IDOCR, error
▼-aliDataValue : struct
[fields]
+RequestId : string
+Success : bool
[embedded]
+IDOCR : IDOCR
▼-aliDetail : struct
[fields]
+OutputLabel : string
+OutputValue : aliOutputValue
▼-aliOutputValue : struct
[fields]
+DataValue : string
▼-aliResult : struct
[fields]
+Outputs : []aliDetail
▼ functions
-getAndBase64(url string) : string, error
-getIDCardImg(faceUrl, backUrl string) : string, string, error
go test -v 146 ↵
=== RUN TestFace
--- PASS: TestFace (2.42s)
=== RUN TestBack
--- PASS: TestBack (1.02s)
=== RUN TestGet
--- PASS: TestGet (2.52s)
=== RUN TestGetIDCard
--- PASS: TestGetIDCard (5.87s)
=== RUN TestFormatResult
--- PASS: TestFormatResult (0.00s)
PASS
ok _/Users/philiptang/Code/aliyun-id-ocr 11.855s
详细打印
go test -v -stderrthreshold=INFO
FAQs
Unknown package
Did you know?

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.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.