https://github.com/golang-infrastructure/go-luhn
Luhn algorithm(银行卡校验算法)
https://github.com/golang-infrastructure/go-luhn
Last synced: 3 months ago
JSON representation
Luhn algorithm(银行卡校验算法)
- Host: GitHub
- URL: https://github.com/golang-infrastructure/go-luhn
- Owner: golang-infrastructure
- License: mit
- Created: 2023-01-07T07:39:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T04:04:13.000Z (over 2 years ago)
- Last Synced: 2025-01-18T16:11:10.841Z (5 months ago)
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Luhn
# 一、这是什么?
一个银行卡校验算法,用于离线计算银行卡是否合法,关于Luhn的详情请移步[https://www.cnblogs.com/cc11001100/p/9357177.html](https://www.cnblogs.com/cc11001100/p/9357177.html)# 二、安装
```bash
go get -u github.com/golang-infrastructure/go-Luhn
```# 三、示例
```go
package mainimport (
"fmt"
luhn "github.com/golang-infrastructure/go-Luhn"
)func main() {
b := luhn.Check("8703008427912866")
fmt.Println(b)
// Output:
// trueb = luhn.Check("8703008427912861")
fmt.Println(b)
// Output:
// false
}
```